Merge pull request #21 from ben1009/dependabot/github_actions/step-se… #59
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
permissions: | |
contents: read | |
on: | |
push: | |
branches: [main, master] | |
pull_request: | |
merge_group: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
RUST_TOOLCHAIN: nightly-2023-12-21 | |
name: Test | |
jobs: | |
required: | |
runs-on: ubuntu-latest | |
name: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: true | |
- name: Install ${{ env.RUST_TOOLCHAIN }} | |
uses: dtolnay/rust-toolchain@e12eda571dc9a5ee5d58eecf4738ec291c66f295 # master | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
- name: cargo generate-lockfile | |
if: hashFiles('Cargo.lock') == '' | |
run: cargo generate-lockfile | |
# https://twitter.com/jonhoo/status/1571290371124260865 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- name: cargo nextest --locked | |
run: cargo nextest run --locked --workspace --all-features --all-targets | |
os-check: | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, windows-latest, macos-14] | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: true | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
- name: cargo generate-lockfile | |
if: hashFiles('Cargo.lock') == '' | |
run: cargo generate-lockfile | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- name: cargo nextest | |
run: cargo nextest run --locked --all-features --all-targets | |
coverage: | |
runs-on: ubuntu-latest | |
name: coverage | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: true | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
components: llvm-tools-preview | |
- name: cargo install cargo-llvm-cov | |
uses: taiki-e/install-action@29ee91bbad05696171dd917a8c7a3838049b93d5 # cargo-llvm-cov | |
- name: cargo generate-lockfile | |
if: hashFiles('Cargo.lock') == '' | |
run: cargo generate-lockfile | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- name: cargo llvm-cov | |
run: cargo llvm-cov nextest --locked --workspace --all-features --all-targets --lcov --output-path lcov.info | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # v4.0.1 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} # required |