Skip to content

Commit 2e254b6

Browse files
authored
Merge pull request #198 from esmf-org/feature/spack_ci
Add artifacts to Spack build action for debugging
2 parents af72305 + d678fd2 commit 2e254b6

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

.github/workflows/scripts/run_nuopc_app_proto.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ echo "-------------"
8989
echo "PASSED TESTS:"
9090
echo "-------------"
9191
cat testProtos_summary.log | grep "PASS"
92+
echo "::endgroup::"
93+
9294
if [[ ! -z "$result_fail" ]]; then
93-
echo "Some of NUOPC app prototypes are failed! Exiting ..."
94-
exit 1
95+
echo "NUOPC_APP_PROTO_PASS=$(echo 'false')" >> $GITHUB_ENV
96+
else
97+
echo "NUOPC_APP_PROTO_PASS=$(echo 'true')" >> $GITHUB_ENV
9598
fi
96-
echo "::endgroup::"

.github/workflows/test-build-spack.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,44 @@ jobs:
119119
-r ${{ github.workspace }}
120120
121121
# checkout NUOPC app prototypes
122-
- name: Checkout NUOPC app prototypes
122+
- name: Checkout NUOPC App Prototypes
123123
uses: actions/checkout@v3
124124
with:
125125
repository: esmf-org/nuopc-app-prototypes
126126
path: ${{ github.workspace }}/nuopc-app-prototypes
127127
ref: ${{ needs.set-matrix.outputs.nuopc_app_version }}
128128

129129
# test installation using NUOPC app prototypes
130-
- name: Run NUOPC app prototypes
130+
- name: Run NUOPC App Prototypes
131131
run: |
132132
${{ github.workspace }}/.github/workflows/scripts/run_nuopc_app_proto.sh \
133133
-c ${{ matrix.compiler }} \
134134
-r ${{ github.workspace }}/nuopc-app-prototypes \
135135
-s ~/.spack-ci
136+
137+
# compress run directory of NUOPC app prototypes
138+
- name: Prepare NUOPC App Prototypes Artifacts Directory
139+
run: |
140+
cd ${{ github.workspace }}/nuopc-app-prototypes
141+
mkdir Artifacts
142+
mv NUOPC-PROTO-RESULTS Artifacts/
143+
144+
# push test results to artifacts
145+
- name: Upload Artifacts
146+
uses: actions/upload-artifact@v3
147+
with:
148+
name: Artifacts for ${{ matrix.compiler }} ${{ matrix.esmf }}
149+
path: ${{ github.workspace }}/nuopc-app-prototypes/Artifacts
150+
retention-days: 5
151+
152+
# force to fail if there is any failed nuopc app prototypes
153+
- name: Check Result of NUOPC App Prototypes
154+
run: |
155+
if [[ "${{ env.NUOPC_APP_PROTO_PASS }}" == "false" ]]; then
156+
echo "Some of NUOPC app prototypes are failed! Exiting ..."
157+
exit 1
158+
else
159+
echo "All tests are passed."
160+
exit 0
161+
fi
162+
shell: bash

0 commit comments

Comments
 (0)