|
1 | | -name: Check Set-Up & Build |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | # Controls when the action will run. |
4 | 4 | on: |
|
11 | 11 | # Allows you to run this workflow manually from the Actions tab |
12 | 12 | workflow_dispatch: |
13 | 13 |
|
14 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
15 | | -jobs: |
16 | | - check: |
17 | | - # The type of runner that the job will run on |
18 | | - runs-on: ubuntu-22.04 |
| 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.84.1-2025-01-28-v202502131220" |
19 | 24 |
|
20 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
| 25 | +jobs: |
| 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 }} |
21 | 32 | steps: |
22 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
23 | | - - uses: actions/checkout@v3 |
| 33 | + - id: set_image |
| 34 | + run: echo "CI_IMAGE=${{ env.CI_IMAGE }}" >> $GITHUB_OUTPUT |
24 | 35 |
|
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 |
| 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 }} |
| 42 | + steps: |
| 43 | + - name: Checkout sources |
| 44 | + uses: actions/checkout@v4 |
29 | 45 |
|
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 |
34 | 52 |
|
35 | 53 | # 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 |
37 | 59 |
|
38 | | - - name: Check Build |
| 60 | + - name: Cargo check |
39 | 61 | 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 | + # Rust cache |
| 75 | + - name: Rust cache |
| 76 | + uses: Swatinem/rust-cache@v2 |
| 77 | + with: |
| 78 | + cache-on-failure: true |
| 79 | + cache-all-crates: true |
41 | 80 |
|
42 | | - - name: Check Build for Benchmarking |
| 81 | + - name: Cargo check (benchmarking) |
43 | 82 | run: > |
44 | | - pushd node && |
45 | | - cargo check --features=runtime-benchmarks --release |
| 83 | + cd node && |
| 84 | + cargo check --features=runtime-benchmarks |
0 commit comments