Skip to content

Clean up CI

Clean up CI #20

Workflow file for this run

name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
rust-toolchain:
- stable
- beta
- nightly
feature:
- default
- memchr
- serde
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup | Rust
run: |
rustup toolchain install ${{ matrix.rust-toolchain }} --profile minimal
rustup default ${{ matrix.rust-toolchain }}
- name: Setup cache for cargo
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-${{ matrix.rust-toolchain }}-${{ matrix.feature }}
- name: Measure code coverage with ${{ matrix.feature }} feature
uses: actions-rs/[email protected]
with:
version: '0.16.0'
args: '-v --out Xml --ciserver github-actions --no-default-features --features=${{ matrix.feature }}'
- name: Upload coverage statistics
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
flags: rust-${{ matrix.rust-toolchain }},${{ matrix.feature }}
all-tests:
runs-on: ubuntu-22.04
needs:
- test
if: always()
steps:
- name: Success
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failure
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust stable
run: |
rustup toolchain install stable --profile minimal --component rustfmt
rustup default stable
- name: Check code format
run: |
cargo fmt --all -- --check