Update crate-ci/typos action to v1.28.1 #971
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
# Copyright 2024 Google LLC | |
# | |
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your | |
# option. This file may not be copied, modified, or distributed | |
# except according to those terms. | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
# Run every Wednesday. | |
- cron: '0 0 * * 3' | |
name: CI | |
env: | |
RUSTFLAGS: -Dwarnings | |
jobs: | |
msrv: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- run: | | |
# Extract the MSRV from Cargo.toml. | |
msrv=$(cargo metadata --no-deps --format-version=1 | jq --raw-output '.packages[] | select(.name == "ext4-view") | .rust_version') | |
rustup toolchain install ${msrv} --profile minimal --no-self-update | |
cargo +${msrv} build -p ext4-view | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo check --workspace | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --workspace | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: Swatinem/rust-cache@v2 | |
# Test with no features enabled. | |
- run: cargo test -p ext4-view | |
# Test diff-walk. | |
- run: cargo xtask diff-walk test_data/test_disk1.bin.zst | |
# Run ignored tests. | |
- run: cargo test -p ext4-view -F std -- --ignored | |
# Test with std enabled, and upload coverage results. | |
- uses: taiki-e/install-action@cargo-llvm-cov | |
- run: cargo llvm-cov -F std --lcov --output-path lcov.info | |
- uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: lcov.info | |
fail_ci_if_error: true | |
test-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo test -p ext4-view -F std | |
doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo doc -F std | |
env: | |
RUSTDOCFLAGS: -Dwarnings | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cargo fmt --all -- --check | |
cargo-deny: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: EmbarkStudios/cargo-deny-action@v2 | |
with: | |
arguments: --workspace --all-features | |
spellcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: crate-ci/typos@v1.28.1 | |
bigdiffwalk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Free up disk space | |
# Adapted from: | |
# https://github.com/easimon/maximize-build-space/blob/master/action.yml | |
run: | | |
df -h | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
sudo rm -rf /opt/hostedtoolcache/CodeQL | |
sudo docker image prune --all --force | |
df -h | |
- run: cargo xtask download-big-filesystems | |
- run: cargo xtask diff-walk test_data/chromiumos_root.bin | |
- run: cargo xtask diff-walk test_data/chromiumos_stateful.bin |