ops: update dependabot config #148
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, pull_request] | |
permissions: | |
contents: read | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
cargo: | |
name: Test on ${{ matrix.toolchain }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- beta | |
- nightly | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ matrix.toolchain }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Rust | |
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | |
- name: Install rustfmt | |
run: rustup component add rustfmt | |
- name: Check | |
run: cargo fmt --check --verbose | |
- name: Build | |
run: cargo build --verbose | |
- name: Test | |
run: cargo test --verbose | |
clippy: | |
name: Lint | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: clippy-${{ hashFiles('**/Cargo.lock') }} | |
- run: brew install rust gtk4 libadwaita | |
- run: rustup component add clippy | |
- run: cargo clippy --all-features -- -D clippy::all -D warnings | |
codecov: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
needs: cargo | |
name: Code coverage on ${{ matrix.os }} | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-codecov-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Rust | |
run: rustup update stable | |
- uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: cargo llvm-cov --workspace --lcov --output-path lcov.info | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v4 | |
with: | |
files: lcov.info | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
release: | |
needs: cargo | |
name: Release | |
permissions: | |
contents: write | |
if: github.repository_owner == 'charlesrocket' && startsWith(github.ref, 'refs/tags/') | |
uses: ./.github/workflows/cd.yml | |
secrets: | |
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} |