mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-04 20:42:20 +00:00
The concurrency groups included the commit SHA, so every run was in a group of its own and cancel-in-progress never cancelled a run that a newer push had replaced. Group runs by pull request or ref instead. Only pull request runs are cancelled, so every push to main still gets fully checked and published.
100 lines
2.4 KiB
YAML
100 lines
2.4 KiB
YAML
name: check
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read # Needed to checkout the repository.
|
|
|
|
concurrency:
|
|
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
|
|
# Only cancel superseded pull request runs, so every push to main is fully checked.
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
rustfmt:
|
|
name: rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: harden runner
|
|
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: 'install rust toolchain with rustfmt'
|
|
run: |
|
|
cargo version
|
|
rustup component add rustfmt
|
|
|
|
- name: 'cargo fmt'
|
|
run: cargo fmt --all -- --check
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch:
|
|
- x86_64
|
|
- aarch64
|
|
env:
|
|
TARGET_ARCH: "${{ matrix.arch }}"
|
|
name: 'build ${{ matrix.arch }}'
|
|
steps:
|
|
- name: harden runner
|
|
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: 'install rust toolchain'
|
|
run: |
|
|
cargo version
|
|
|
|
- name: cargo build
|
|
run: cargo build --target "${TARGET_ARCH}-unknown-uefi"
|
|
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch:
|
|
- x86_64
|
|
- aarch64
|
|
env:
|
|
TARGET_ARCH: "${{ matrix.arch }}"
|
|
name: 'clippy ${{ matrix.arch }}'
|
|
steps:
|
|
- name: harden runner
|
|
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: 'install rust toolchain with clippy'
|
|
run: |
|
|
cargo version
|
|
rustup component add clippy
|
|
|
|
- name: cargo clippy
|
|
run: cargo clippy --target "${TARGET_ARCH}-unknown-uefi"
|