Merge pull request #2 from nicolas-vivot/feature/migrating-existing #3
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request_target: | |
branches: | |
- main | |
types: [labeled] | |
jobs: | |
check-lint: | |
name: check-lint | |
runs-on: ubuntu-latest | |
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ${{ github.event_name }} == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: format check | |
run: cargo fmt --all -- --check | |
- name: clippy check | |
run: cargo clippy --all-targets -- -D warnings | |
check-deps: | |
name: check-deps | |
runs-on: ubuntu-latest | |
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ${{ github.event_name }} == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- name: cargo-deny | |
uses: EmbarkStudios/cargo-deny-action@v2 | |
with: | |
arguments: --workspace --all-features | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ${{ github.event_name }} == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: dtolnay/rust-toolchain@stable | |
- name: cargo-test | |
env: | |
RUSTFLAGS: "-A dead_code -A unused" | |
run: cargo test --release --all-features |