-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (62 loc) · 2.41 KB
/
Copy pathci.yaml
File metadata and controls
79 lines (62 loc) · 2.41 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
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [develop, main]
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
check:
name: fmt, clippy, test
# Skip the redundant run on develop push — the PR into develop already ran it.
if: github.event_name != 'push' || github.ref != 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install GTK4 and libadwaita (for the gui crate)
# xvfb provides a virtual display so GTK-dependent tests actually run.
run: sudo apt-get update && sudo apt-get install -y libgtk-4-dev libadwaita-1-dev xvfb
- 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 --workspace --all-targets -- -D warnings
- name: Test
# xvfb-run gives GTK tests a display; PN_REQUIRE_GTK makes them fail
# loudly (rather than skip) if the display is somehow unavailable.
env:
PN_REQUIRE_GTK: "1"
run: xvfb-run -a cargo test --workspace
android:
name: android tests
# Skip the redundant run on develop push — the PR into develop already ran it.
if: github.event_name != 'push' || github.ref != 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- uses: android-actions/setup-android@v4
- name: Install NDK
run: sdkmanager "ndk;26.3.11579264"
# The rust-android-gradle plugin cross-compiles the `mobile` crate; the
# UniFFI bindings are generated from the built .so before Kotlin compiles.
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,x86_64-linux-android
- uses: Swatinem/rust-cache@v2
# verifyRoborazziDebug runs the JVM unit tests (L1) AND verifies the
# screenshot goldens (L3) in one pass. Compose UI tests (L2) need an
# emulator and are run locally, not here.
- name: Unit + screenshot tests
working-directory: android
run: ./gradlew :app:verifyRoborazziDebug