chore: replace CI release workflow with cargo-dist
#45
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
name: PR | |
on: | |
pull_request: | |
branches: | |
- master | |
# Run on push to master as well, to warm caches for future branches | |
push: | |
branches: master | |
env: | |
RUSTFLAGS: -D warnings | |
RUSTDOCFLAGS: -D warnings | |
jobs: | |
fetch: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cargo cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ hashFiles('Cargo.lock') }} | |
path: | | |
~/.cargo/bin | |
~/.cargo/git/db | |
~/.cargo/registry/cache | |
~/.cargo/registry/index | |
Cargo.lock | |
- name: Fetch | |
run: cargo fetch | |
- name: Check Cargo.lock is up to date | |
run: git diff --exit-code || (echo 'Cargo.lock needs updated' && exit 1) | |
check: | |
runs-on: ubuntu-20.04 | |
needs: [fetch] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cargo cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ hashFiles('Cargo.lock') }} | |
path: | | |
~/.cargo/bin | |
~/.cargo/git/db | |
~/.cargo/registry/cache | |
~/.cargo/registry/index | |
Cargo.lock | |
- name: Check cache | |
uses: actions/cache@v4 | |
with: | |
key: check-${{ hashFiles('Cargo.lock') }} | |
path: target | |
- name: Check | |
run: cargo check --all-targets --locked | |
clippy: | |
runs-on: ubuntu-20.04 | |
needs: [check] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cargo cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ hashFiles('Cargo.lock') }} | |
path: | | |
~/.cargo/bin | |
~/.cargo/git/db | |
~/.cargo/registry/cache | |
~/.cargo/registry/index | |
Cargo.lock | |
- name: Check cache | |
uses: actions/cache@v4 | |
with: | |
key: check-${{ hashFiles('Cargo.lock') }} | |
path: target | |
- name: Clippy | |
run: cargo clippy --all-targets --locked | |
doc-check: | |
runs-on: ubuntu-20.04 | |
needs: [check] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cargo cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ hashFiles('Cargo.lock') }} | |
path: | | |
~/.cargo/bin | |
~/.cargo/git/db | |
~/.cargo/registry/cache | |
~/.cargo/registry/index | |
Cargo.lock | |
- name: Check cache | |
uses: actions/cache@v4 | |
with: | |
key: check-${{ hashFiles('Cargo.lock') }} | |
path: target | |
- name: Doc check | |
run: cargo doc --no-deps --locked | |
test: | |
runs-on: ubuntu-20.04 | |
needs: [fetch] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cargo cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ hashFiles('Cargo.lock') }} | |
path: | | |
~/.cargo/bin | |
~/.cargo/git/db | |
~/.cargo/registry/cache | |
~/.cargo/registry/index | |
Cargo.lock | |
- name: Test cache | |
uses: actions/cache@v4 | |
with: | |
key: test-${{ hashFiles('Cargo.lock') }} | |
path: target | |
- name: Test | |
run: cargo test --locked |