Get a failure check working. #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Test the scripts. | ||
|
Check failure on line 1 in .github/workflows/scripts.yaml
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| # Settings for run-with-summary script. | ||
| env: | ||
| FILE: report-${{ github.run_id }}.md | ||
| SUMMARY: yes | ||
| jobs: | ||
| run-with-summary: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: run-with-summary | ||
| run: | | ||
| set -o pipefail | ||
| set +e | ||
| ./src/run-with-summary ps -a | ||
| exit_code=$? | ||
| cat $FILE >> $GITHUB_STEP_SUMMARY | ||
| echo "EXIT_CODE=$exit_code" >> $GITHUB_ENV | ||
| run-with-summary-fail: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| FILE: report-${{ github.run_id }}.md | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: run-with-summary failure | ||
| run: | | ||
| set -o pipefail | ||
| set +e | ||
| ./src/run-with-summary ping w3.org -c1 | ||
| exit_code=$? | ||
| cat $FILE >> $GITHUB_STEP_SUMMARY | ||
| echo "EXIT_CODE=$exit_code" >> $GITHUB_ENV | ||
| run: | | ||
| if [ "$EXIT_CODE" == "0" ]; then | ||
| echo "Script was expected to fail. Something is wrong." | ||
| exit 1 | ||
| else | ||
| echo "Exit code is not 0, as expected." | ||
| fi | ||
| - name: Exit | ||