misc: Update readme #14
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: json-structural-diff | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
GRCOV_VERSION: "0.8.20" | |
jobs: | |
clippy-rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: Run rustfmt | |
run: | |
cargo fmt --all -- --check --verbose | |
- name: Run cargo clippy | |
run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic | |
code-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: llvm-tools-preview | |
- name: Install grcov | |
env: | |
GRCOV_LINK: https://github.com/mozilla/grcov/releases/download | |
run: | | |
curl -L "$GRCOV_LINK/v$GRCOV_VERSION/grcov-x86_64-unknown-linux-musl.tar.bz2" | | |
tar xj -C $HOME/.cargo/bin | |
- name: Run tests | |
env: | |
RUSTFLAGS: "-Cinstrument-coverage" | |
LLVM_PROFILE_FILE: "json-structural-diff-%p-%m.profraw" | |
run: | | |
cargo test --verbose | |
- name: Get coverage data for codecov | |
run: | | |
grcov . --binary-path ./target/debug/ -s . -t lcov --branch \ | |
--ignore-not-existing --ignore "/*" --ignore "../*" -o lcov.info | |
- name: Codecov upload | |
uses: codecov/codecov-action@v4 | |
with: | |
files: lcov.info | |
token: ${{ secrets.CODECOV_TOKEN }} | |
tests: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build | |
run: | | |
cargo build --workspace --all-features | |
- name: Run no-default-features tests | |
run: | | |
cargo test --no-default-features | |
- name: Run all-features tests | |
run: | | |
cargo test --all-features | |
- name: Generate docs | |
run: | | |
cargo doc --all-features --no-deps |