-
-
Notifications
You must be signed in to change notification settings - Fork 49
123 lines (107 loc) · 3.55 KB
/
ci.yaml
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
115
116
117
118
119
120
121
122
123
name: 'Stump Checks CI'
on:
pull_request:
push:
branches:
- main
- develop
jobs:
code-changes-check:
runs-on: [ubuntu-22.04]
outputs:
changes: ${{ steps.filter.outputs.changes }}
frontend-changed: ${{ steps.filter.outputs.frontend == 'true' }}
rust-changed: ${{ steps.filter.outputs.rust == 'true' }}
docs-changed: ${{ steps.filter.outputs.docs == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
docs:
- './docs/**'
frontend:
- './apps/web/**'
- './apps/desktop/src/**'
- './packages/**'
expo:
- './apps/expo/**'
rust:
- './apps/server/**'
- './apps/desktop/src-tauri/**'
- './core/**'
- './crates/**'
docker: ./docker/**
check-rust:
needs: code-changes-check
if: "!contains(github.event.pull_request.head.ref, 'release/v') && needs.code-changes-check.outputs.rust-changed == 'true'"
name: Rust checks
runs-on: [self-hosted]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup rust
uses: ./.github/actions/setup-rust
with:
cache-dependencies: false
- name: Run cargo checks
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
- name: Generate typescript bindings
run: cargo codegen -- --skip-prisma
- name: Verify typescript bindings
run: |
git diff --exit-code || \
(echo "Please generate updated typescript bindings with \`cargo codegen -- --skip-prisma\`" \
&& exit 1)
- name: Run tests
run: cargo test
- name: Run codegen
run: cargo codegen -- --skip-prisma
- name: Verify up-to-date bindings
run: |
git diff --exit-code || \
(echo "Please generate updated bindings with \`cargo codegen -- --skip-prisma\`" \
&& exit 1)
check-coverage:
if: "!contains(github.event.pull_request.head.ref, 'release/v') && needs.code-changes-check.outputs.rust-changed == 'true'"
name: Coverage checks
needs: [code-changes-check, check-rust]
runs-on: [self-hosted]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run coverage
uses: ./.github/actions/coverage
with:
token: ${{ secrets.CODECOV_TOKEN }}
cache-dependencies: false
check-typescript:
needs: code-changes-check
if: "!contains(github.event.pull_request.head.ref, 'release/v') && needs.code-changes-check.outputs.frontend-changed == 'true'"
name: TypeScript checks
runs-on: [ubuntu-22.04]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node and Yarn
uses: ./.github/actions/setup-yarn
- name: Run TypeScript lints
run: yarn lint
- name: Run TypeScript tests
run: yarn test
# TODO(ci): Add vercel dev deployment?
check-docs:
needs: code-changes-check
if: "!contains(github.event.pull_request.head.ref, 'release/v') && needs.code-changes-check.outputs.docs-changed == 'true'"
name: Check documentation
runs-on: [ubuntu-22.04]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node and Yarn
uses: ./.github/actions/setup-yarn
- name: Build documentation app
run: yarn docs build