Skip to content

Commit

Permalink
Preflight workflow (#5692)
Browse files Browse the repository at this point in the history
Preflight reusable workflow - aggregated workflow to perform all
preliminary jobs
It currently includes:
- check changed files
- `set-image` (and runner) job
- useful variables
  • Loading branch information
AndWeHaveAPlan authored Sep 16, 2024
1 parent 655382f commit 1e25ada
Show file tree
Hide file tree
Showing 16 changed files with 359 additions and 566 deletions.
36 changes: 9 additions & 27 deletions .github/workflows/build-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,16 @@ permissions:
contents: read

jobs:
set-image:
# GitHub Actions allows using 'env' in a container context.
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
# This workaround sets the container image for each job using 'set-image' job output.
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
- id: set_runner
run: |
# Run merge queues on persistent runners
if [[ $GITHUB_REF_NAME == *"gh-readonly-queue"* ]]; then
echo "RUNNER=arc-runners-polkadot-sdk-beefy-persistent" >> $GITHUB_OUTPUT
else
echo "RUNNER=arc-runners-polkadot-sdk-beefy" >> $GITHUB_OUTPUT
fi

preflight:
uses: ./.github/workflows/reusable-preflight.yml

build-runtimes-polkavm:
timeout-minutes: 20
needs: [set-image]
runs-on: ${{ needs.set-image.outputs.RUNNER }}
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.set-image.outputs.IMAGE }}
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -64,10 +46,10 @@ jobs:
build-subkey:
timeout-minutes: 20
needs: [set-image]
runs-on: ${{ needs.set-image.outputs.RUNNER }}
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.set-image.outputs.IMAGE }}
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
Loading

0 comments on commit 1e25ada

Please sign in to comment.