Repository navigation
114 lines (97 loc) · 3.63 KB
/
Copy pathci.yml
File metadata and controls
114 lines (97 loc) · 3.63 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
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
rust:
name: rust (${{ matrix.name }})
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
# The xbps and apk backends are mutually exclusive, so each is checked on its own.
matrix:
include:
- name: xbps
image: ghcr.io/void-linux/void-glibc-full:latest
args: --workspace
- name: xbps + adwaita
image: ghcr.io/void-linux/void-glibc-full:latest
args: --workspace --features caerus/adwaita
- name: apk + adwaita
image: ghcr.io/void-linux/void-glibc-full:latest
args: -p caerus --no-default-features --features apk,adwaita
steps:
- name: Install build dependencies
run: |
xbps-install -Sy
xbps-install -uy xbps
xbps-install -Suy
xbps-install -y base-devel libxbps-devel gtk4-devel libadwaita-devel pkg-config rust cargo git clang zstd
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Formatting
if: matrix.name == 'xbps'
run: cargo fmt --all -- --check
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
key: ${{ matrix.name }}
cache-on-failure: true
- name: Clippy
run: cargo clippy ${{ matrix.args }} --all-targets --locked -- -D warnings
- name: Test
run: cargo test ${{ matrix.args }} --locked
- name: GTK smoke test
if: matrix.name == 'xbps'
run: |
xbps-install -y xvfb-run xorg-server-xvfb dbus dejavu-fonts-ttf
GSK_RENDERER=cairo xvfb-run -a cargo test -p caerus --locked -- --ignored --test-threads=1
# JavaScript actions cannot run inside a musl container, so build there with docker.
musl:
name: rust (xbps musl)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Clippy and test
run: |
docker run --rm -v "$PWD:/src" -w /src ghcr.io/void-linux/void-musl-full:latest sh -euc '
xbps-install -Sy
xbps-install -uy xbps
xbps-install -Suy
xbps-install -y base-devel libxbps-devel gtk4-devel libadwaita-devel pkg-config rust cargo git clang zstd
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
'
scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- name: ShellCheck
run: shellcheck -S warning -x install.sh get-caerus.sh scripts/*.sh
- name: Script tests
run: |
for test in scripts/test-check-discover-void.py scripts/test-install-prefix.py \
scripts/test-release-lookup.py scripts/test-user-install.py; do
echo "::group::$test"
python3 "$test"
echo "::endgroup::"
done
- name: CodeRabbit configuration
run: |
uv run scripts/test-check-coderabbit.py
uv run scripts/check-coderabbit.py