Couple improvements. #249
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: main | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- 1.83.0 | |
- beta | |
- nightly | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | |
- run: rustup component add clippy | |
- run: rustup component add rustfmt | |
- name: Build - no features | |
run: cargo build --verbose --all-targets --no-default-features | |
- name: Build - std | |
run: cargo build --verbose --all-targets --no-default-features --features std | |
- name: Build - serde | |
run: cargo build --verbose --all-targets --no-default-features --features serde | |
- name: Build - macros | |
run: cargo build --verbose --all-targets --no-default-features --features macros | |
- name: Build - emit | |
run: cargo build --verbose --all-targets --no-default-features --features emit | |
- name: Check | |
run: cargo check --verbose --all-targets | |
- name: Clippy | |
run: cargo clippy --verbose --all-targets | |
- name: Format | |
run: cargo fmt -- --check | |
- name: Tests | |
run: cargo test --verbose | |
- name: Doc Tests | |
run: cargo test --doc --verbose | |
- name: Doc | |
run: cargo doc --all-features | |
- name: Publish | |
run: cargo publish -p frozen-collections-core --dry-run | |
coverage: | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TERM_COLOR: always | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
run: rustup update stable | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: lcov.info | |
fail_ci_if_error: true |