-
Notifications
You must be signed in to change notification settings - Fork 13
86 lines (84 loc) · 2.67 KB
/
ci.yml
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
on:
push:
branches:
- main
- v*.x
pull_request:
branches:
- main
- v*.x
name: Continuous integration
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: dtolnay/rust-toolchain@stable
id: toolchain
with:
targets: ${{ matrix.target }}
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}-
${{ runner.os }}-dot-cargo-
- uses: actions/cache@v4
with:
path: |
./crates/jxl-oxide-tests/tests/cache/
key: jxl-oxide-fixtures-0-${{ hashFiles('crates/jxl-oxide-tests/tests/*.rs') }}
restore-keys: |
jxl-oxide-fixtures-0-
- name: Install cross
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cross
git: https://github.com/cross-rs/cross
rev: 7b79041c9278769eca57fae10c74741f5aa5c14b
- name: Run tests
run: cross test --release --target ${{ matrix.target }} -- --test-threads 1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: images
path: crates/jxl-oxide-tests/tests/.artifact/
clippy:
name: Rustfmt and Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
id: toolchain
with:
components: clippy
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-dot-cargo-${{ steps.toolchain.outputs.cacheKey }}-
${{ runner.os }}-dot-cargo-
- run: cargo fmt --all --check
# these should install everything
- run: sudo apt update && sudo apt install -y libavfilter-dev libavdevice-dev
- run: |
cargo clippy --all --no-default-features -- -D warnings
cargo clippy --all -- -D warnings
cargo clippy --all --all-features -- -D warnings