-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Moving cargo check for runtimes to GHA
- Loading branch information
1 parent
819a581
commit e8462f0
Showing
2 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'cargo check runtimes' | ||
description: 'Runs `cargo check` for every directory in provided root.' | ||
inputs: | ||
root: | ||
description: "Root directory. Expected to contain several cargo packages inside." | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check | ||
shell: bash | ||
run: | | ||
mkdir -p ~/.forklift | ||
cp .forklift/config.toml ~/.forklift/config.toml | ||
cd ${{ inputs.root }} | ||
for directory in $(echo */); do | ||
echo "_____Running cargo check for ${directory} ______"; | ||
cd ${directory}; | ||
pwd; | ||
SKIP_WASM_BUILD=1 forklift cargo check --locked; | ||
cd ..; | ||
done |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: Check Cargo Check Runtimes | ||
|
||
on: | ||
pull_request: | ||
types: [ opened, synchronize, reopened, ready_for_review ] | ||
|
||
|
||
# Jobs in this workflow depend on each other, only for limiting peak amount of spawned workers | ||
|
||
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 | ||
timeout-minutes: 20 | ||
outputs: | ||
IMAGE: ${{ steps.set_image.outputs.IMAGE }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- id: set_image | ||
run: cat .github/env >> $GITHUB_OUTPUT | ||
check-runtime-assets: | ||
runs-on: arc-runners-polkadot-sdk-beefy | ||
needs: [set-image] | ||
container: | ||
image: docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run cargo check | ||
uses: ./.github/actions/cargo-check-runtimes | ||
with: | ||
root: cumulus/parachains/runtimes/assets | ||
|
||
check-runtime-collectives: | ||
runs-on: arc-runners-polkadot-sdk-beefy | ||
needs: [check-runtime-assets, set-image] | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run cargo check | ||
uses: ./.github/actions/cargo-check-runtimes | ||
with: | ||
root: cumulus/parachains/runtimes/collectives | ||
|
||
check-runtime-coretime: | ||
runs-on: arc-runners-polkadot-sdk-beefy | ||
needs: [check-runtime-assets, set-image] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run cargo check | ||
uses: ./.github/actions/cargo-check-runtimes | ||
with: | ||
root: cumulus/parachains/runtimes/coretime | ||
|
||
check-runtime-bridge-hubs: | ||
runs-on: arc-runners-polkadot-sdk-beefy | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
needs: [check-runtime-collectives, set-image] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run cargo check | ||
uses: ./.github/actions/cargo-check-runtimes | ||
with: | ||
root: cumulus/parachains/runtimes/bridge-hubs | ||
|
||
check-runtime-contracts: | ||
runs-on: arc-runners-polkadot-sdk-beefy | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
needs: [check-runtime-collectives, set-image] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run cargo check | ||
uses: ./.github/actions/cargo-check-runtimes | ||
with: | ||
root: cumulus/parachains/runtimes/contracts | ||
|
||
check-runtime-starters: | ||
runs-on: arc-runners-polkadot-sdk-beefy | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
needs: [check-runtime-assets, set-image] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run cargo check | ||
uses: ./.github/actions/cargo-check-runtimes | ||
with: | ||
root: cumulus/parachains/runtimes/starters | ||
|
||
check-runtime-testing: | ||
runs-on: arc-runners-polkadot-sdk-beefy | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
needs: [check-runtime-starters, set-image] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run cargo check | ||
uses: ./.github/actions/cargo-check-runtimes | ||
with: | ||
root: cumulus/parachains/runtimes/testing |