Skip to content

Commit b3c8038

Browse files
committed
Use Parity CI image for workflow
1 parent 437b295 commit b3c8038

File tree

1 file changed

+68
-22
lines changed

1 file changed

+68
-22
lines changed

.github/workflows/check.yml

Lines changed: 68 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check Set-Up & Build
1+
name: CI
22

33
# Controls when the action will run.
44
on:
@@ -11,35 +11,81 @@ on:
1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:
1313

14-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
# Cancel previous runs
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
# Parity CI image to use
20+
# Common variable is defined in the workflow
21+
# Repo env variable doesn't work for PRs from forks
22+
env:
23+
CI_IMAGE: "paritytech/ci-unified:bullseye-1.75.0-2024-01-22-v20240222"
24+
1525
jobs:
16-
check:
17-
# The type of runner that the job will run on
18-
runs-on: ubuntu-22.04
26+
set-image:
27+
# This workaround sets the container image for each job using 'set-image' job output.
28+
# env variables don't work for PRs from forks, so we need to use outputs.
29+
runs-on: ubuntu-latest
30+
outputs:
31+
CI_IMAGE: ${{ steps.set_image.outputs.CI_IMAGE }}
32+
steps:
33+
- id: set_image
34+
run: echo "CI_IMAGE=${{ env.CI_IMAGE }}" >> $GITHUB_OUTPUT
1935

20-
# Steps represent a sequence of tasks that will be executed as part of the job
36+
check:
37+
name: Cargo check
38+
runs-on: ubuntu-latest
39+
needs: [set-image]
40+
container:
41+
image: ${{ needs.set-image.outputs.CI_IMAGE }}
2142
steps:
22-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23-
- uses: actions/checkout@v3
43+
- name: Checkout sources
44+
- uses: actions/checkout@v4
2445

25-
- name: Install linux dependencies
26-
run: |
27-
sudo apt-get update
28-
sudo apt-get install -y clang libssl-dev llvm libudev-dev protobuf-compiler
29-
30-
- name: Install Rust
31-
run: |
32-
rustup update stable --no-self-update
33-
rustup target add wasm32-unknown-unknown
46+
- name: Install Rust stable toolchain
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
profile: minimal
50+
toolchain: stable
51+
override: true
3452

3553
# Rust cache
36-
- uses: Swatinem/rust-cache@v2
54+
- name: Rust cache
55+
uses: Swatinem/rust-cache@v2
56+
with:
57+
cache-on-failure: true
58+
cache-all-crates: true
3759

38-
- name: Check Build
60+
- name: Cargo check
3961
run: |
40-
SKIP_WASM_BUILD=1 cargo check --release
62+
SKIP_WASM_BUILD=1 cargo check
63+
64+
check-benchmarking:
65+
name: Cargo check (benchmarking)
66+
runs-on: ubuntu-latest
67+
needs: [set-image]
68+
container:
69+
image: ${{ needs.set-image.outputs.CI_IMAGE }}
70+
steps:
71+
- name: Checkout sources
72+
- uses: actions/checkout@v4
73+
74+
- name: Install Rust stable toolchain
75+
uses: actions-rs/toolchain@v1
76+
with:
77+
profile: minimal
78+
toolchain: stable
79+
override: true
80+
81+
# Rust cache
82+
- name: Rust cache
83+
uses: Swatinem/rust-cache@v2
84+
with:
85+
cache-on-failure: true
86+
cache-all-crates: true
4187

42-
- name: Check Build for Benchmarking
88+
- name: Cargo check (benchmarking)
4389
run: >
4490
pushd node &&
45-
cargo check --features=runtime-benchmarks --release
91+
cargo check --features=runtime-benchmarks

0 commit comments

Comments
 (0)