widen pattern type from &str to AsRef<str> (#31) #130
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: Rust | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-Dwarnings" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: true | |
- name: Cache Cargo dependencies | |
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1 | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: | | |
cargo test --verbose -- --include-ignored | |
cargo test --verbose --all-features -- --include-ignored | |
- name: Run Clippy | |
run: cargo clippy --all-targets | |
- name: Run Format Check | |
run: cargo fmt --check | |
check-msrv: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: true | |
- name: Get MSRV | |
id: msrv | |
run: echo "msrv=$(cargo metadata --no-deps --format-version=1 | jq -r ".packages[] | select(.name==\"jlabel\") | .rust_version")" >> $GITHUB_OUTPUT | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@439cf607258077187679211f12aa6f19af4a0af7 # master | |
with: | |
toolchain: ${{ steps.msrv.outputs.msrv }} | |
- name: Cache Cargo dependencies | |
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1 | |
- name: Print version | |
run: | | |
cargo --version | |
rustc --version | |
- name: Run test | |
run: | | |
cargo test --verbose | |
cargo test --verbose --all-features | |
coverage: | |
runs-on: ubuntu-latest | |
container: | |
image: xd009642/tarpaulin:develop-nightly | |
options: --security-opt seccomp=unconfined | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: true | |
- name: Generate code coverage | |
run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true |