chore(version): 6.2.0 #3
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: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: Tests for platform ${{ matrix.os }}/${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
coverage: true | |
conventional_commit_check: true | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
force_lf: true | |
- os: ubuntu-latest | |
target: armv7-unknown-linux-musleabihf | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
steps: | |
- if: ${{ matrix.force_lf }} | |
run: | | |
git config --global core.eol lf; | |
git config --global core.autocrlf input; | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
key: "${{ matrix.os }}-${{ matrix.target }}" | |
- run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git config --global user.email [email protected] | |
git config --global user.name github-actions | |
- name: Conventional commit check | |
if: ${{matrix.conventional_commit_check }} | |
uses: cocogitto/[email protected] | |
with: | |
git-user: "github-actions" | |
git-user-email: "[email protected]" | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
- name: Install cargo-llvm-cov | |
if: ${{matrix.coverage}} | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- name: Collect coverage data | |
if: ${{matrix.coverage}} | |
run: cargo llvm-cov nextest --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
if: ${{matrix.coverage}} | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: lcov.info | |
fail_ci_if_error: true | |
- name: Test | |
if: ${{ ! matrix.coverage }} | |
uses: actions-rs/cargo@v1 | |
with: | |
command: nextest | |
args: run | |
lints: | |
name: Lints & Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: "true" | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
continue-on-error: false | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Run cargo clippy | |
uses: actions-rs/cargo@v1 | |
continue-on-error: false | |
with: | |
command: clippy | |
args: -- -D warnings |