-
Notifications
You must be signed in to change notification settings - Fork 4
107 lines (88 loc) · 3.54 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI
on:
push:
pull_request:
types:
- opened
- synchronize
env:
MSRV: '1.64.0'
jobs:
msrv_check:
name: MSRV check
runs-on: ubuntu-22.04
# Exclude in-repo PRs from running this job
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: 📥 Checkout source
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
submodules: recursive
- name: 🧰 Install MSRV toolchain
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # v1
with:
toolchain: ${{ env.MSRV }}
- name: 💨 Cache Rust artifacts
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: ⚙️ Run tests
run: cargo test -p ogg_next_sys -p aotuv_lancer_vorbis_sys -p vorbis_rs
ci:
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-apple-darwin
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-22.04
packages-to-test: -p ogg_next_sys -p aotuv_lancer_vorbis_sys -p vorbis_rs
- target: aarch64-unknown-linux-gnu
runner: ubuntu-22.04
packages-to-test: -p ogg_next_sys -p aotuv_lancer_vorbis_sys -p vorbis_rs
- target: x86_64-pc-windows-gnu
runner: windows-2022
# Low-level FFI binding crates mostly contain layout tests
# that assume a Unix-like platform, so they won't work
# on Windows
packages-to-test: -p vorbis_rs
- target: x86_64-apple-darwin
runner: macos-11
packages-to-test: -p ogg_next_sys -p aotuv_lancer_vorbis_sys -p vorbis_rs
name: CI (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
# Exclude in-repo PRs from running this job
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: 📥 Checkout source
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
submodules: recursive
- name: 🧰 Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
target: ${{ matrix.target }}
components: rust-src, rustfmt, clippy
- name: 🧰 Install ARM64 cross-compilation toolchain
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt update && sudo apt install -yq gcc-aarch64-linux-gnu libc6-arm64-cross qemu-user
- name: 💨 Cache Rust artifacts
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: '🔍 Static analysis: run Clippy'
uses: giraffate/clippy-action@13b9d32482f25d29ead141b79e7e04e7900281e0 # v1
if: matrix.target == 'x86_64-unknown-linux-gnu'
with:
clippy_flags: --no-deps -- -D warnings
reporter: github-check
fail_on_error: true
- name: '🔍 Static analysis: run rustfmt'
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: cargo fmt --check --all
- name: ✔️ Run tests
env:
# Handle AArch64 dynamic libraries installed by libc6-arm64-cross
# being in a path that the dynamic linker does not check by default
LD_LIBRARY_PATH: /usr/aarch64-linux-gnu/lib
run: cargo test --release --target ${{ matrix.target }} -Zdoctest-xcompile
${{ matrix.packages-to-test }} -- --nocapture