generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (90 loc) · 2.7 KB
/
pull_request.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
# SPDX-FileCopyrightText: 2024 Felix Hilgers <[email protected]>
#
# SPDX-License-Identifier: MIT
name: PR
on:
workflow_dispatch:
pull_request:
branches: [main, dev]
env:
RUSTFLAGS: "-Dwarnings"
CARGO_INCREMENTAL: 0
jobs:
reuse-lint:
name: Reuse Lint
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Reuse Lint
run: nix develop --command reuse lint
sbom:
name: Generate Sbom
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Generate Sbom
run: nix develop --command python utils/generate_sbom.py
rust-lint:
name: Rust Lint
runs-on: self-hosted
needs: [reuse-lint]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-rust-cache
with:
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
- name: Cargo Clippy
run: |
cd rust
nix develop --command cargo clippy --all-targets --all-features
rust-test:
name: Rust Tests
runs-on: self-hosted
needs: [rust-lint]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-rust-cache
with:
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
- name: Cargo test
run: |
cd rust
nix develop --command cargo test --workspace --all-targets --all-features --exclude backend-daemon
rust-build:
name: Rust Build
runs-on: self-hosted
needs: [rust-test]
strategy:
matrix:
target: [arm64-v8a, x86_64]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-rust-cache
with:
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
cacheKey: ${{ matrix.target }}
- name: Cargo Build Daemon ${{ matrix.target }}
run: |
cd rust
nix develop --command cargo ndk --target ${{ matrix.target }} build --package backend-daemon --package client
gradle-build:
name: Gradle Build
runs-on: self-hosted
needs: [reuse-lint]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-rust-cache
with:
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
- uses: ./.github/actions/setup-gradle-cache
with:
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
- name: Gradle Lint
run: |
cd frontend
nix develop --command ./gradlew build --no-daemon --parallel