diff --git a/.github/workflows/build_and_run_workflow.yml b/.github/workflows/build_and_run_workflow.yml index 9928b2ead1..dac8469fab 100644 --- a/.github/workflows/build_and_run_workflow.yml +++ b/.github/workflows/build_and_run_workflow.yml @@ -86,6 +86,15 @@ jobs: run: shell: bash steps: + - name: Set Job Context + run: | + echo "JOB_NAME=${{ github.job }}" >> $GITHUB_ENV + echo "JOB_STATUS=started" >> $GITHUB_ENV + echo "GITHUB_WORKFLOW=${{ github.workflow }}" >> $GITHUB_ENV + echo "GITHUB_RUN_ID=${{ github.run_id }}" >> $GITHUB_ENV + echo "GITHUB_REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV + echo "GITHUB_ACTOR=${{ github.actor }}" >> $GITHUB_ENV + # This default behavior will check out the push and pull_request code correctly. - name: Checkout push code uses: actions/checkout@v4 @@ -167,12 +176,9 @@ jobs: cd /$TMP_DIR/ci_test # Check the last 5 lines for 'failed' or 'error:' (case-insensitive) if tail -n 5 "$TMP_OUTPUT" | grep -iE 'failed|error:'; then - echo "Test failed" - cat /tmp/ci_test/run/cesm.log* - exit 911 - else - echo "Test passed" + exit 911 # Test failed fi + echo "JOB_STATUS=${{ job.status }}" - name: Upload logs to GitHub artifacts when the CI test fails if: failure() @@ -223,4 +229,4 @@ jobs: - name: Extract the netCDF output files from CIRRUS storage if: env.GENERATE_BASELINE != 'true' run: | - aws s3 --no-verify-ssl --endpoint-url $AWS_ENDPOINT_URL sync s3://stormspeed/baselines/${{ matrix.runner }}/${{ matrix.compset }}_${{ matrix.res }}_${{ matrix.compiler }}_${{ matrix.dycore }}/ /$TMP_DIR/ci_test/baselines/ --region $AWS_DEFAULT_REGION --exclude "*" --include "*cam.h0a*.nc" --include "*cam.h0i*.nc" --include "*cam.i*.nc" \ No newline at end of file + aws s3 --no-verify-ssl --endpoint-url $AWS_ENDPOINT_URL sync s3://stormspeed/baselines/${{ matrix.runner }}/${{ matrix.compset }}_${{ matrix.res }}_${{ matrix.compiler }}_${{ matrix.dycore }}/ /$TMP_DIR/ci_test/baselines/ --region $AWS_DEFAULT_REGION --exclude "*" --include "*cam.h0a*.nc" --include "*cam.h0i*.nc" --include "*cam.i*.nc"