Skip to content

Extend behavior of fail-on-error option to setup failures #41

Extend behavior of fail-on-error option to setup failures

Extend behavior of fail-on-error option to setup failures #41

Workflow file for this run

name: Test Modified GitHub Action Steps
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-modified-steps:
runs-on: ubuntu-latest
strategy:
matrix:
step: [download, report, done]
fail_on_error: [true, false]
steps:
- name: Checkout code
uses: actions/checkout@v3
# Test Download & Verification Step
- name: Test Download & Verification
if: ${{ matrix.step == 'download' }}
shell: bash
run: |
echo "Testing Download & Verification"
asset_path="latest/download"
# Simulate download and verification failure scenario
if ! curl -sLO "https://github.com/coverallsapp/coverage-reporter/releases/${asset_path}/coveralls-linux.tar.gz" ||
! curl -sLO "https://github.com/coverallsapp/coverage-reporter/releases/${asset_path}/coveralls-checksums.txt" ||
! grep coveralls-linux.tar.gz coveralls-checksums.txt | sha256sum --check; then
echo "Download or verification failed."
if [ "${{ matrix.fail_on_error }}" == "false" ]; then exit 0; else exit 1; fi
fi
echo "Download & verification succeeded."
# Test Coveralls Report Step
- name: Test Coveralls Report
if: ${{ matrix.step == 'report' }}
shell: bash
run: |
echo "Testing Coveralls Report Step"
if [ ! -f ~/bin/coveralls ]; then
echo "Coveralls binary not found."
if [ "${{ matrix.fail_on_error }}" == "false" ]; then exit 0; else exit 1; fi
fi
# Simulate coveralls report execution
~/bin/coveralls report || {
echo "Coveralls report failed."
if [ "${{ matrix.fail_on_error }}" == "false" ]; then exit 0; else exit 1; fi
}
echo "Coveralls report succeeded."
# Test Coveralls Done Step
- name: Test Coveralls Done
if: ${{ matrix.step == 'done' }}
shell: bash
run: |
echo "Testing Coveralls Done Step"
if [ ! -f ~/bin/coveralls ]; then
echo "Coveralls binary not found."
if [ "${{ matrix.fail_on_error }}" == "false" ]; then exit 0; else exit 1; fi
fi
# Simulate coveralls done execution
~/bin/coveralls done || {
echo "Coveralls done failed."
if [ "${{ matrix.fail_on_error }}" == "false" ]; then exit 0; else exit 1; fi
}
echo "Coveralls done succeeded."