-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (60 loc) · 2.03 KB
/
Copy pathci.yml
File metadata and controls
75 lines (60 loc) · 2.03 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
65
66
67
68
69
70
71
72
73
74
75
name: CI
on:
push:
branches: [main, develop]
paths-ignore: ["**.md", "docs/**", "assets/icons/**"]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
jobs:
quality:
name: Format · Clippy · Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install slint build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libxkbcommon-dev libwayland-dev wayland-protocols \
libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
libfontconfig1-dev libgl1-mesa-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test
coverage:
name: Coverage (core ≥ 80%)
# The instrumented build is the most expensive job, so only run it where it
# matters: pull requests and pushes to main (not on every develop push).
if: github.event_name != 'push' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install slint build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libxkbcommon-dev libwayland-dev wayland-protocols \
libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
libfontconfig1-dev libgl1-mesa-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Library coverage (fail under 80% lines)
run: cargo llvm-cov --lib --fail-under-lines 80