-
Notifications
You must be signed in to change notification settings - Fork 26
95 lines (80 loc) · 2.86 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
name: CI
on:
workflow_dispatch:
push:
branches: ["master"]
pull_request:
branches: ["master"]
merge_group:
types: [checks_requested]
jobs:
build:
runs-on: ubuntu-latest
container: fedora:latest
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: sudo dnf -y install clang cmake gtk4-devel ibus-devel libadwaita-devel libchewing-devel ibus gettext weston
- name: Build
run: |
cmake --preset default
cmake --build --preset default --verbose
cmake --build --preset default -t install --verbose
- name: Test
env:
XDG_RUNTIME_DIR: /tmp
GSETTINGS_BACKEND: keyfile
run: |
glib-compile-schemas src/setup --targetdir=build/bin
weston --no-config --socket=wl-headless --backend=headless &
WAYLAND_DISPLAY=wl-headless cmake --build --preset default -t test --verbose
coverage:
runs-on: ubuntu-latest
container: fedora:latest
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: sudo dnf -y install clang cmake gtk4-devel ibus-devel libadwaita-devel libchewing-devel ibus gettext weston
- name: Install llvm
run: |
sudo dnf -y install llvm rustup bzip2 git
rustup-init -y
source "$HOME/.cargo/env"
rustup component add llvm-tools
- name: Setup grcov
run: |
curl -LO https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-x86_64-unknown-linux-gnu.tar.bz2
echo 098be4d60b8016913542d58456fea6e771890096d1bf86e7f83dac650ba4b58a grcov-x86_64-unknown-linux-gnu.tar.bz2 | sha256sum -c -
tar xf grcov-x86_64-unknown-linux-gnu.tar.bz2
- name: Build
run: |
cmake --preset c23-coverage
cmake --build --preset c23-coverage --verbose
- name: Test
env:
XDG_RUNTIME_DIR: /tmp
GSETTINGS_BACKEND: keyfile
run: |
source "$HOME/.cargo/env"
glib-compile-schemas src/setup --targetdir=build/bin
weston --no-config --socket=wl-headless --backend=headless &
WAYLAND_DISPLAY=wl-headless cmake --build --preset c23-coverage -t test --verbose
./grcov . -s . -b . --keep-only 'src/*' --llvm -t lcov -o coverage.lcov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# https://github.com/orgs/community/discussions/26822
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [build]
steps:
- run: exit 1
# see https://stackoverflow.com/a/67532120/4907315
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}