CI #76
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: CI | |
on: | |
push: | |
branches: | |
- master | |
- main | |
paths-ignore: | |
- .github/CODE_OF_CONDUCT.md | |
- .github/CODEOWNERS | |
- .github/dependabot.yml | |
- .github/FUNDING.yml | |
- LICENSE | |
- .gitignore | |
pull_request: | |
paths-ignore: | |
- .github/CODE_OF_CONDUCT.md | |
- .github/CODEOWNERS | |
- .github/dependabot.yml | |
- .github/FUNDING.yml | |
- LICENSE | |
- .gitignore | |
schedule: | |
- cron: "0 5 * * 1,3,6" | |
permissions: | |
contents: read | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: --deny warnings | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Init toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
id: toolchain | |
with: | |
toolchain: nightly | |
components: rustfmt,clippy | |
- name: Fmt | |
run: cargo fmt --check | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: v2-cargo-${{runner.os}}-${{steps.toolchain.outputs.cachekey}}-${{ hashFiles('**/Cargo.lock') }}-lint- | |
restore-keys: | | |
v2-cargo-${{runner.os}}-${{steps.toolchain.outputs.cachekey}}-${{ hashFiles('**/Cargo.lock') }}-test | |
v2-cargo-${{runner.os}}-${{steps.toolchain.outputs.cachekey}}- | |
v2-cargo-${{runner.os}} | |
- name: Clippy | |
run: cargo clippy --workspace --tests --no-deps --all-features | |
- name: Install cargo-rdme | |
continue-on-error: true | |
run: cargo install cargo-rdme --debug --version ^1 | |
- name: Run cargo-rdme | |
run: cargo rdme --check | |
test: | |
name: Test / ${{matrix.toolchain}} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- nightly | |
- stable | |
- 1.60.0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Init toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
id: toolchain | |
with: | |
toolchain: ${{matrix.toolchain}} | |
- name: Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: v2-cargo-${{runner.os}}-${{steps.toolchain.outputs.cachekey}}-${{ hashFiles('**/Cargo.lock') }}-test- | |
restore-keys: | | |
v2-cargo-${{runner.os}}-${{steps.toolchain.outputs.cachekey}}-${{ hashFiles('**/Cargo.lock') }}-lint | |
v2-cargo-${{runner.os}}-${{steps.toolchain.outputs.cachekey}}- | |
v2-cargo-${{runner.os}} | |
# Test | |
- name: Test (default) | |
run: cargo test --workspace --locked | |
- name: Test (attr_parse) | |
run: cargo test --workspace --locked --features attr_parse | |
- name: Test (attr_parse,full) | |
run: cargo test --workspace --locked --features attr_parse,full | |
- name: Test (all) | |
if: ${{ matrix.toolchain == 'nightly' }} | |
run: cargo test --workspace --locked --all-features | |
- name: Test (none) | |
run: cargo test --workspace --locked --no-default-features | |
# Examples | |
- name: Examples (all) | |
if: ${{ matrix.toolchain == 'nightly' }} | |
run: cargo test --examples --all-features --locked | |
- name: Examples (attr_parse,full) | |
run: cargo test --examples --locked --features attr_parse,full |