|
| 1 | +# Checks that doesn't require heavy lifting, like formatting, linting, etc. |
| 2 | +name: quick-checks |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + types: [opened, synchronize, reopened, ready_for_review] |
| 7 | + merge_group: |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + set-image: |
| 14 | + # GitHub Actions allows using 'env' in a container context. |
| 15 | + # However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322 |
| 16 | + # This workaround sets the container image for each job using 'set-image' job output. |
| 17 | + runs-on: arc-runners-polkadot-sdk-default |
| 18 | + timeout-minutes: 10 |
| 19 | + outputs: |
| 20 | + IMAGE: ${{ steps.set_image.outputs.IMAGE }} |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v4 |
| 24 | + - id: set_image |
| 25 | + run: cat .github/env >> $GITHUB_OUTPUT |
| 26 | + fmt: |
| 27 | + runs-on: arc-runners-polkadot-sdk-default |
| 28 | + timeout-minutes: 10 |
| 29 | + needs: [set-image] |
| 30 | + container: |
| 31 | + image: ${{ needs.set-image.outputs.IMAGE }} |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 34 | + - name: Cargo fmt |
| 35 | + run: cargo +nightly fmt --all -- --check |
| 36 | + check-dependency-rules: |
| 37 | + runs-on: arc-runners-polkadot-sdk-default |
| 38 | + timeout-minutes: 10 |
| 39 | + needs: [set-image] |
| 40 | + container: |
| 41 | + image: ${{ needs.set-image.outputs.IMAGE }} |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 44 | + - name: check dependency rules |
| 45 | + run: | |
| 46 | + cd substrate/ |
| 47 | + ../.gitlab/ensure-deps.sh |
| 48 | + check-rust-feature-propagation: |
| 49 | + runs-on: arc-runners-polkadot-sdk-default |
| 50 | + # runs-on: ubuntu-latest |
| 51 | + timeout-minutes: 10 |
| 52 | + needs: [set-image] |
| 53 | + container: |
| 54 | + image: ${{ needs.set-image.outputs.IMAGE }} |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 57 | + - name: run zepter |
| 58 | + run: zepter run check |
| 59 | + test-rust-features: |
| 60 | + runs-on: arc-runners-polkadot-sdk-default |
| 61 | + # runs-on: ubuntu-latest |
| 62 | + timeout-minutes: 10 |
| 63 | + needs: [set-image] |
| 64 | + container: |
| 65 | + image: ${{ needs.set-image.outputs.IMAGE }} |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 68 | + - name: run rust features |
| 69 | + run: bash .gitlab/rust-features.sh . |
| 70 | + check-toml-format: |
| 71 | + runs-on: arc-runners-polkadot-sdk-default |
| 72 | + timeout-minutes: 10 |
| 73 | + needs: [set-image] |
| 74 | + container: |
| 75 | + image: ${{ needs.set-image.outputs.IMAGE }} |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 78 | + - name: check toml format |
| 79 | + run: | |
| 80 | + taplo format --check --config .config/taplo.toml |
| 81 | + echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues" |
0 commit comments