generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
212 lines (176 loc) · 13.2 KB
/
commitChecks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# This workflow builds the WRES and executes system tests against various scenarios
name: Code Checks
on:
push:
pull_request:
jobs:
Build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- 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 build
./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
systests:
needs: Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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
# Download artifacts from previous step
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
github-token: ${{ github.token }}
# Set env variables for zip versions
- name: Set git envs
run: |
# Get the wres versions from their respective zips and storing these to env
echo "wres_version=$(ls build-artifacts/build/distributions | tail -1 | cut -d '-' -f 2-3 | cut -d'.' -f 1)" >> "$GITHUB_ENV"
echo "wres_vis=$(ls build-artifacts/wres-vis/build/distributions | tail -1 | cut -d '-' -f 3-4 | cut -d'.' -f 1)" >> "$GITHUB_ENV"
echo "wres_writing=$(ls build-artifacts/wres-writing/build/distributions | tail -1 | cut -d '-' -f 3-4 | cut -d'.' -f 1)" >> "$GITHUB_ENV"
unzip build-artifacts/systests/build/distributions/systests-*[a-f0-9].zip
echo "systests_dir=$( ls -1d systests-*[a-f0-9] )" >> "$GITHUB_ENV"
# Run systests
- name: System tests in memory
run: |
echo "Starting the system tests in memory..."
# Configure the parameters sent to the test JVM in the settings file (avoids some quoting/escaping issues).
# TODO: replace with -P gradle property overrides in the test command once the quoting/escaping issues can be worked out
sed -i "s/testJvmSystemProperties =.*/testJvmSystemProperties = -Dwres.useSSL=false -Dwres.useDatabase=false -Djava.awt.headless=true -Dwres.dataDirectory=. -Djava.io.tmpdir=.. -Ducar.unidata.io.http.maxReadCacheSize=200000 -Ducar.unidata.io.http.httpBufferSize=200000 -Dwres.attemptToMigrate=false -Duser.timezone=UTC -Dwres.externalGraphics=false -Dwres.externalNumerics=false -Dwres.startBroker=false -Dwres.eventsBrokerAddress=localhost -Dwres.eventsBrokerPort=5673/g" $systests_dir/gradle.properties
sed -i "s/testJvmSystemPropertiesGraphics =.*/testJvmSystemPropertiesGraphics = -Djava.io.tmpdir=. -Dwres.startBroker=true -Dwres.eventsBrokerAddress=localhost -Dwres.eventsBrokerPort=5673/g" $systests_dir/gradle.properties
sed -i "s/testJvmSystemPropertiesWriting =.*/testJvmSystemPropertiesWriting = -Djava.io.tmpdir=. -Dwres.startBroker=false -Dwres.eventsBrokerAddress=localhost -Dwres.eventsBrokerPort=5673/g" $systests_dir/gradle.properties
# Run the tests
$systests_dir/gradlew -p $systests_dir cleanTest test -PwresZipDirectory=../build-artifacts/build/distributions/ -PwresGraphicsZipDirectory=../build-artifacts/wres-vis/build/distributions/ -PwresWritingZipDirectory=../build-artifacts/wres-writing/build/distributions/ -PversionToTest=$wres_version -PgraphicsVersionToTest=$wres_vis -PwritingVersionToTest=$wres_writing --tests=Scenario052 --tests=Scenario053 --tests=Scenario1000 --tests=Scenario1001 --tests=Scenario500 --tests=Scenario501 --tests=Scenario502 --tests=Scenario504 --tests=Scenario505 --tests=Scenario506 --tests=Scenario507 --tests=Scenario508 --tests=Scenario509 --tests=Scenario510 --tests=Scenario511 --tests=Scenario512 --tests=Scenario513 --tests=Scenario514 --tests=Scenario720 --tests=Scenario721
# Save the test results
mkdir -p test_results_0
mv systests-*/build/reports/tests/test/* test_results_0
mv systests-*/build/*.log test_results_0
# Run systests
- name: System tests with external graphics and numerics writing
run: |
echo "Starting the system tests with external graphics and numerics writing..."
# Configure the parameters sent to the test JVM in the settings file (avoids some quoting/escaping issues).
# TODO: replace with -P gradle property overrides in the test command once the quoting/escaping issues can be worked out
sed -i "s/testJvmSystemProperties =.*/testJvmSystemProperties = -Dwres.useSSL=false -Dwres.useDatabase=true -Dwres.databaseJdbcUrl=jdbc:h2:mem:test;MODE=REGULAR;TRACE_LEVEL_FILE=4;DB_CLOSE_DELAY=-1;INIT=create schema if not exists wres\\; -Djava.awt.headless=true -Dwres.dataDirectory=. -Djava.io.tmpdir=.. -Ducar.unidata.io.http.maxReadCacheSize=200000 -Ducar.unidata.io.http.httpBufferSize=200000 -Dwres.attemptToMigrate=true -Duser.timezone=UTC -Dwres.externalGraphics=true -Dwres.externalNumerics=true -Dwres.startBroker=false -Dwres.eventsBrokerAddress=localhost -Dwres.eventsBrokerPort=5673/g" $systests_dir/gradle.properties
sed -i "s/testJvmSystemPropertiesGraphics =.*/testJvmSystemPropertiesGraphics = -Djava.io.tmpdir=. -Dwres.startBroker=true -Dwres.eventsBrokerAddress=localhost -Dwres.eventsBrokerPort=5673/g" $systests_dir/gradle.properties
sed -i "s/testJvmSystemPropertiesWriting =.*/testJvmSystemPropertiesWriting = -Djava.io.tmpdir=. -Dwres.startBroker=false -Dwres.eventsBrokerAddress=localhost -Dwres.eventsBrokerPort=5673/g" $systests_dir/gradle.properties
# Run the tests using a separate graphics and writing process
$systests_dir/gradlew -p $systests_dir cleanTest test -PwresZipDirectory=../build-artifacts/build/distributions/ -PwresGraphicsZipDirectory=../build-artifacts/wres-vis/build/distributions/ -PwresWritingZipDirectory=../build-artifacts/wres-writing/build/distributions/ -PversionToTest=$wres_version -PgraphicsVersionToTest=$wres_vis -PwritingVersionToTest=$wres_writing --tests=Scenario052 --tests=Scenario053 --tests=Scenario1000 --tests=Scenario1001 --tests=Scenario500 --tests=Scenario501 --tests=Scenario502 --tests=Scenario504 --tests=Scenario505 --tests=Scenario506 --tests=Scenario507 --tests=Scenario508 --tests=Scenario509 --tests=Scenario510 --tests=Scenario511 --tests=Scenario512 --tests=Scenario513 --tests=Scenario514 --tests=Scenario720 --tests=Scenario721
# Save the test results
mkdir -p test_results_1
mv systests-*/build/reports/tests/test/* test_results_1
mv systests-*/build/*.log test_results_1
# Run systests
- name: System tests with an H2 in-memory database
run: |
echo "Starting the system tests with an H2 in-memory database..."
# Configure the parameters sent to the test JVM in the settings file (avoids some quoting/escaping issues).
# TODO: replace with -P gradle property overrides in the test command once the quoting/escaping issues can be worked out
sed -i "s/testJvmSystemProperties =.*/testJvmSystemProperties = -Dwres.useSSL=false -Dwres.databaseJdbcUrl=jdbc:h2:mem:test;MODE=REGULAR;TRACE_LEVEL_FILE=4;DB_CLOSE_DELAY=-1;INIT=create schema if not exists wres\\; -Djava.awt.headless=true -Dwres.dataDirectory=. -Djava.io.tmpdir=.. -Ducar.unidata.io.http.maxReadCacheSize=200000 -Ducar.unidata.io.http.httpBufferSize=200000 -Dwres.attemptToMigrate=true -Duser.timezone=UTC -Dwres.externalGraphics=false -Dwres.externalNumerics=false/g" $systests_dir/gradle.properties
# Run the tests again using a self-contained graphics/eventsbroker process
$systests_dir/gradlew -p $systests_dir cleanTest test -PwresZipDirectory=../build-artifacts/build/distributions/ -PwresGraphicsZipDirectory=../build-artifacts/wres-vis/build/distributions/ -PwresWritingZipDirectory=../build-artifacts/wres-writing/build/distributions/ -PversionToTest=$wres_version -PgraphicsVersionToTest=$wres_vis -PwritingVersionToTest=$wres_writing --tests=Scenario052 --tests=Scenario053 --tests=Scenario1000 --tests=Scenario1001 --tests=Scenario500 --tests=Scenario501 --tests=Scenario502 --tests=Scenario504 --tests=Scenario505 --tests=Scenario506 --tests=Scenario507 --tests=Scenario508 --tests=Scenario509 --tests=Scenario510 --tests=Scenario511 --tests=Scenario512 --tests=Scenario513 --tests=Scenario514 --tests=Scenario720 --tests=Scenario721
# Save the test results
mkdir -p test_results_2
mv systests-*/build/reports/tests/test/* test_results_2
# Run systests
- name: System tests with the legacy XML evaluation language
run: |
echo "Starting the system tests with the legacy XML evaluation language..."
# Configure the parameters sent to the test JVM in the settings file (avoids some quoting/escaping issues).
# TODO: replace with -P gradle property overrides in the test command once the quoting/escaping issues can be worked out
sed -i "s/testJvmSystemProperties =.*/testJvmSystemProperties = -Dwres.useSSL=false -Dwres.databaseJdbcUrl=jdbc:h2:mem:test;MODE=REGULAR;TRACE_LEVEL_FILE=4;DB_CLOSE_DELAY=-1;INIT=create schema if not exists wres\\; -Djava.awt.headless=true -Dwres.dataDirectory=. -Djava.io.tmpdir=.. -Ducar.unidata.io.http.maxReadCacheSize=200000 -Ducar.unidata.io.http.httpBufferSize=200000 -Dwres.attemptToMigrate=true -Duser.timezone=UTC -Dwres.externalGraphics=false -Dwres.externalNumerics=false -Dwres.xml=true/g" $systests_dir/gradle.properties
# Run the tests again using a self-contained graphics/eventsbroker process
$systests_dir/gradlew -p $systests_dir cleanTest test -PwresZipDirectory=../build-artifacts/build/distributions/ -PwresGraphicsZipDirectory=../build-artifacts/wres-vis/build/distributions/ -PwresWritingZipDirectory=../build-artifacts/wres-writing/build/distributions/ -PversionToTest=$wres_version -PgraphicsVersionToTest=$wres_vis -PwritingVersionToTest=$wres_writing --tests=Scenario052 --tests=Scenario053 --tests=Scenario1000 --tests=Scenario1001 --tests=Scenario500 --tests=Scenario501 --tests=Scenario502 --tests=Scenario504 --tests=Scenario505 --tests=Scenario506 --tests=Scenario507 --tests=Scenario508 --tests=Scenario509 --tests=Scenario510 --tests=Scenario511 --tests=Scenario512 --tests=Scenario720 --tests=Scenario721
# Save the test results
mkdir -p test_results_3
mv systests-*/build/reports/tests/test/* test_results_3
# Archive the artifacts created from this build
- name: Archive system tests
uses: actions/upload-artifact@v4
with:
name: systest-result-artifacts
path: |
test_results_0
test_results_1
test_results_2
test_results_3
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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