Repository navigation
64 lines (53 loc) · 1.81 KB
/
Copy pathci.yml
File metadata and controls
64 lines (53 loc) · 1.81 KB
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
name: CI
on:
workflow_dispatch:
push:
branches:
- "main"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_NET_RETRY: "10"
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- name: Install dependencies
run: |
set -eux
sudo apt-get -o Acquire::Retries=5 update
sudo apt-get -o Acquire::Retries=5 install -y --no-install-recommends \
build-essential pkg-config ca-certificates libsdl2-dev \
crossbuild-essential-armhf
- name: Rust toolchain
run: |
set -eux
rustup show
rustc --version
# Dependencies built once and reused; saved from main only, so a pull
# request restores it without spending the quota on its own copy.
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Format
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
# The integration tests are headless (no SDL): real TCP round-trips
# against the receive server, plus the loopback send worker.
- name: Test
run: cargo test
# armhf is a release target but nothing else here compiles 32-bit. No
# linking, so only ring's C code needs the cross compiler — no SDL
# sysroot (the release build gets one, see Cross.toml).
- name: Check armhf
env:
CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc
run: |
set -eux
rustup target add armv7-unknown-linux-gnueabihf
cargo check --all-targets --target armv7-unknown-linux-gnueabihf