-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (115 loc) · 3.44 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# 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