Fail the can_proceed job instead of skipping it #10
Workflow file for this run
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
--- | ||
name: CI | ||
run-name: Merge CI triggered from @${{ github.actor }} of ${{ github.head_ref }} | ||
on: | ||
merge_group: | ||
jobs: | ||
# --- Determine which files have changed --- | ||
changes: | ||
name: Detect file changes | ||
runs-on: ubuntu-4 | ||
outputs: | ||
arbitrator_changed: ${{ steps.changed.outputs.arbitrator_any_changed }} | ||
bold_legacy_changed: ${{ steps.changed.outputs.bold_legacy_any_changed }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v5 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 10 # Will cover most PRs | ||
persist-credentials: true # In case changed-files requires deeper depth | ||
- name: Determine if Arbitrator or Bold Legacy changed | ||
id: changed | ||
uses: tj-actions/[email protected] | ||
with: | ||
files_yaml: | | ||
arbitrator: | ||
- 'arbitrator/**' | ||
- 'contracts/**' | ||
- 'Makefile' | ||
bold_legacy: | ||
- 'bold/legacy/**' | ||
# --- Fast: Build + Lint only --- | ||
fast: | ||
uses: ./.github/workflows/_fast.yml | ||
secrets: inherit | ||
# --- Run Arbitrator tests --- | ||
arbitrator: | ||
needs: changes | ||
if: needs.changes.outputs.arbitrator_changed == 'true' | ||
uses: ./.github/workflows/_arbitrator.yml | ||
secrets: inherit | ||
# --- Run Bold Legacy challenge tests --- | ||
bold-legacy: | ||
needs: changes | ||
if: needs.changes.outputs.bold_legacy_changed == 'true' | ||
uses: ./.github/workflows/_bold-legacy.yml | ||
secrets: inherit | ||
# --- Full GO tests --- | ||
go-tests: | ||
uses: ./.github/workflows/_go-tests.yml | ||
secrets: inherit | ||
can_proceed: | ||
runs-on: ubuntu-4 | ||
needs: [fast, arbitrator, bold-legacy, go-tests] | ||
if: always() | ||
steps: | ||
- name: Aggregate results | ||
run: | | ||
ok=1 | ||
for r in fast go-tests arbitrator bold-legacy; do | ||
result="${{ needs[r].result }}" | ||
if [ "$result" != "success" ] && [ "$result" != "skipped" ]; then | ||
echo "$r failed ($result)" | ||
ok=0 | ||
fi | ||
done | ||
if [ $ok -eq 0 ]; then | ||
echo "Some required jobs failed" | ||
exit 1 | ||
fi | ||
can_see_status: | ||
# This job is just to make sure that the "can_proceed" job's status is visible | ||
# on the pull request page, even if it is skipped due to all its dependencies being | ||
# skipped. It does not depend on any other jobs, so it always runs. | ||
runs-on: ubuntu-4 | ||
steps: | ||
- run: true |