name: CI
on:
workflow_call:
schedule:
- cron: '0 0 1 * *' push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: --deny warnings
jobs:
build_test_lint:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [stable, nightly, "1.81"]
profile: [dev, release]
features: ["" , full_expected_cwd, unstable, "unstable,full_expected_cwd"]
exclude:
- features: unstable
toolchain: stable
- features: "unstable,full_expected_cwd"
toolchain: stable
- features: unstable
toolchain: "1.81"
- features: "unstable,full_expected_cwd"
toolchain: "1.81"
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add clippy rustfmt
- run: cargo build --profile ${{ matrix.profile }} --no-default-features ${{ matrix.features != '' && '--features' || '' }} ${{ matrix.features }} --all-targets
- run: cargo test --profile ${{ matrix.profile }} --no-default-features ${{ matrix.features != '' && '--features' || '' }} ${{ matrix.features }}
- run: cargo clippy --profile ${{ matrix.profile }} --no-default-features ${{ matrix.features != '' && '--features' || '' }} ${{ matrix.features }} --all-targets
- run: cargo test --profile ${{ matrix.profile }} --no-default-features ${{ matrix.features != '' && '--features' || '' }} ${{ matrix.features }} -- --ignored full_expected_cwd_tests::test_get_expected_inits_expected
if: ${{ contains( matrix.features, 'full_expected_cwd' ) }}
- run: cargo test --profile ${{ matrix.profile }} --no-default-features ${{ matrix.features != '' && '--features' || '' }} ${{ matrix.features }} -- --ignored full_expected_cwd_tests::test_get_inits_expected
if: ${{ contains( matrix.features, 'full_expected_cwd' ) }}
- run: cargo test --profile ${{ matrix.profile }} --no-default-features ${{ matrix.features != '' && '--features' || '' }} ${{ matrix.features }} -- --ignored full_expected_cwd_tests::test_set_inits_expected
if: ${{ contains( matrix.features, 'full_expected_cwd' ) }}
- run: cargo bench --profile ${{ matrix.profile }} --no-default-features ${{ matrix.features != '' && '--features' || '' }} ${{ matrix.features }} --all-targets
if: ${{ contains( matrix.features, 'unstable' ) && matrix.toolchain == 'nightly' && matrix.profile == 'release' }}
- run: cargo fmt --check --all
- run: cargo publish --dry-run
coverage:
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:latest-slim
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v4
- run: rustup update stable
- run: cargo tarpaulin --verbose
- uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: tarpaulin-report.html