Skip to content

Feature/v2

Feature/v2 #6

Workflow file for this run

name: Catch and Flow
on: [ push, pull_request ]
jobs:
rustfmt:
runs-on: ubuntu-latest
permissions:
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: LoliGothick/rustfmt-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
flags: --all
args: --config-path=./.cargo-husky/hooks/rustfmt.toml
clippy:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: -- -Dwarning
deny:
name: Run cargo-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
rust-version: stable
log-level: warn
command: check
arguments: --all-features
test:
needs: [ rustfmt, clippy, deny ]
name: "Test: { target: ${{ matrix.os }}, channel: ${{ matrix.rust }} }"
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
rust: [ stable ]
include:
- os: ubuntu-latest
target: unknown-linux-musl
sccache:
path: /home/runner/.cache/sccache
exe: ""
- os: macos-latest
target: apple-darwin
sccache:
path: /Users/runner/Library/Caches/Mozilla.sccache
exe: ""
- os: windows-latest
target: pc-windows-msvc
sccache:
path: /Users/runner/%LOCALAPPDATA%\Mozilla\sccache
exe: ".exe"
env:
RUST_BACKTRACE: full
RUSTV: ${{ matrix.rust }}
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ${{ matrix.sccache-path }}
# SCCACHE_RECACHE: 1 # Uncomment this to clear cache, then comment it back out
RUSTC_WRAPPER: sccache
steps:
- uses: actions/checkout@v4
- name: Setup Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/registry/index/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Save sccache
id: restore-sccache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
${{ matrix.sccache.path }}
~/.cargo/bin/sccache${{ matrix.exe }}
key: ${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache
- if: ${{ steps.restore-sccache.outputs.cache-hit == false }}
name: install sccache
uses: taiki-e/install-action@v2
with:
tool: sccache
- name: Start sccache server
run: sccache --start-server
- name: Run test_suite
run: cargo test --all-features
- name: Print sccache stats
run: sccache --show-stats
- name: Stop sccache server
run: sccache --stop-server || true