-
Notifications
You must be signed in to change notification settings - Fork 10
192 lines (154 loc) · 5.02 KB
/
build_and_test.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Build and Test with Coverage
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule: # Build every day at 5PM UTC
- cron: '0 17 * * *'
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -C instrument-coverage
LLVM_PROFILE_FILE: pigg-%p-%m.profraw
RUST_BACKTRACE: 1
jobs:
markdown-link-check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
Format-check:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo fmt check
run: cargo fmt --all -- --check
all-feature-combinations:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install cargo-all-features
run: cargo install cargo-all-features
- name: cargo check-all-features
run: cargo check-all-features
arm7-build:
runs-on: ubuntu-latest
steps:
- name: Clean up files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Add target
run: rustup target add armv7-unknown-linux-gnueabihf
- name: Install armv7 Linker
run: |
sudo apt update
sudo apt install -y gcc-arm-linux-gnueabihf
- name: Checkout
uses: actions/checkout@v4
- name: Build for armv7
run: cargo build --target=armv7-unknown-linux-gnueabihf
arm7-musl-build:
runs-on: ubuntu-latest
steps:
- name: Clean up files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Add target
run: rustup target add armv7-unknown-linux-musleabihf
- name: Install armv7 Linker
run: |
sudo apt update
sudo apt install -y gcc-arm-linux-gnueabihf
- name: Checkout
uses: actions/checkout@v4
- name: Build for armv7-musl
run: RUSTFLAGS= cargo build --target=armv7-unknown-linux-musleabihf
aarch64-build:
runs-on: ubuntu-latest
steps:
- name: Clean up files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Add target
run: rustup target add aarch64-unknown-linux-gnu
- name: Install aarch64 Linker
run: |
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
- name: Checkout
uses: actions/checkout@v4
- name: Build for aarch64
run: cargo build --target=aarch64-unknown-linux-gnu
porky-release-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: add thumbv6m-none-eabi target
run: rustup target add thumbv6m-none-eabi
- name: Install cargo binstall
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install elf2uf2-rs
run: cargo binstall elf2uf2-rs
- name: Build porky and porky_w and their UF2 files
run: cd porky && RUSTFLAGS= make uf2
clippy-build-and-test-matrix:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-15, ubuntu-24.04, windows-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy,llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: InstallCoverageTools
if: runner.os != 'Windows'
run: cargo install grcov
- name: Setup LCOV
if: runner.os != 'Windows'
uses: hrishikesh-kadam/setup-lcov@v1
with:
ref: HEAD
- name: Clippy build and test - non-Linux
if: runner.os != 'Linux'
run: make clippy build test
- name: Clippy build and test - Linux
if: runner.os == 'Linux'
run: |
make clippy build
sudo apt-get update
sudo apt-get install weston
weston -Bheadless -Sweston &
make test
env:
WAYLAND_DISPLAY: weston
- name: Clean up coverage
if: runner.os != 'Windows'
run: |
grcov . --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
lcov --ignore-errors unused --ignore-errors unsupported --ignore-errors empty,empty --remove lcov.info -o lcov.info --erase-functions "(?=^.*fmt).+"
- name: UploadCoverage
if: runner.os != 'Windows'
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
file: lcov.info
flags: unittests
name: codecov-umbrella
verbose: true