Skip to content

Create build.yml

Create build.yml #1

Workflow file for this run

# This workflow builds the WRES distros
name: Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
Build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
# Run and build using gradle
# Disable aggregateJavaDocs
- name: Run build
run: ./gradlew distZip testCodeCoverageReport javadoc
# Confirm the test code inside wres-external-services-tests zip compiles
- name: Compile external-services-tests
run: |
cd wres-external-services-tests
../gradlew installDist
cd build/install/wres-external-services-tests
./gradlew testClasses
# Create the system tests zip
- name: Create systests zip
run: |
cd systests
../gradlew distZip installDist
# Create the admin scripts zip
- name: Create admin scripts
run: |
cd scripts
../gradlew distZip
- name: Creating md5
run: |
md5sum build/distributions/wres-*.zip >> checksum.txt
md5sum wres-*/build/distributions/wres-*-*.zip >> checksum.txt
md5sum systests/build/distributions/systests-*.zip >> checksum.txt
md5sum scripts/build/distributions/wres-admin-scripts-*.zip >> checksum.txt
# Archive the artifacts created from this build
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
checksum.txt
build/distributions/wres-*.zip
wres-*/build/distributions/wres-*-*.zip
systests/build/distributions/systests-*.zip
scripts/build/distributions/wres-admin-scripts-*.zip
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0