-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (112 loc) · 3.55 KB
/
development.yml
File metadata and controls
131 lines (112 loc) · 3.55 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Dev CI (fast)
on:
push:
branches: [ Dev ]
paths:
- 'Frontend/**'
- 'Backend/**'
- 'crates/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/development.yml'
pull_request:
branches: [ Dev ]
paths:
- 'Frontend/**'
- 'Backend/**'
- 'crates/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/development.yml'
concurrency:
group: dev-${{ github.ref }}
cancel-in-progress: true
jobs:
dev:
runs-on: ubuntu-24.04
permissions:
contents: read
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: 'true'
SCCACHE_CACHE_SIZE: '2G'
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
submodules: recursive
# Dev CI doesn't need LFS assets; skipping saves bandwidth and disk.
lfs: false
- name: Free disk space (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
set -euxo pipefail
df -h
# GitHub-hosted runners come with large preinstalled SDKs we don't need.
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc || true
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/* || true
df -h
# ---------- Frontend: lint + typecheck ----------
- name: Setup Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: Frontend/package-lock.json
- name: Install frontend deps
working-directory: Frontend
run: npm ci --no-audit --no-fund
- name: Lint
working-directory: Frontend
run: npm run lint --if-present
- name: Typecheck
working-directory: Frontend
run: npm run typecheck --if-present
# ---------- Backend: cargo check ----------
- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
with:
components: rustfmt, clippy
- name: Setup sccache
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: Install Linux build deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libgtk-3-dev \
libglib2.0-dev \
libgdk-pixbuf-2.0-dev \
libpango1.0-dev \
libsoup-3.0-dev \
libwebkit2gtk-4.1-dev
pkg-config --modversion javascriptcoregtk-4.1
- name: Rust cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
continue-on-error: true
- name: Cargo fmt (check)
run: cargo fmt --all -- --check
- name: Cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: Cargo check
run: cargo check
- name: Install `just`
run: |
# Install `just` via cargo so it's available on the runner
cargo install --locked just || true
- name: Run `just test`
run: |
just --version || true
just test
- name: Cleanup heavy dirs (before post-job cache save)
if: always()
shell: bash
run: |
set -euxo pipefail
du -hs Frontend/node_modules || true
rm -rf Frontend/node_modules || true
df -h