Repository navigation
152 lines (144 loc) · 5.29 KB
/
Copy pathworkflow.yaml
File metadata and controls
152 lines (144 loc) · 5.29 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Lint and Tests
on:
push:
# Every lint/format job is a thin wrapper around `lefthook run pre-commit`
# so lefthook.yml stays the single source of truth for what runs locally and in CI.
jobs:
biome:
name: Biome (lint & format)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
cache: npm
- name: Install deps
run: npm ci
- name: Run lefthook check
run: npx lefthook run pre-commit --commands check --all-files
- name: Verify no formatting drift
run: git diff --exit-code
docs:
name: Docs (prettier & markdownlint)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
cache: npm
- name: Install deps
run: npm ci
- name: Run lefthook docs hooks
run: npx lefthook run pre-commit --commands docs-format,docs-lint --all-files
- name: Verify no formatting drift
run: git diff --exit-code
nix-linux:
name: Nix package (Linux x86_64)
# Heavy (~10min) build; run it only on main like the Tauri platform builds,
# not on every branch/PR push.
if: github.ref == 'refs/heads/main'
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Build obby
run: nix flake check && nix build .#obby --no-link --print-build-logs
i18n:
name: i18n Catalog Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
cache: npm
- name: Install deps
run: npm ci
- name: Run lefthook i18n hook
# Fails if extract/compile produces a diff against committed catalogs.
# Fix: npm run i18n:extract && npm run i18n:compile, commit src/locales/.
run: npx lefthook run pre-commit --commands i18n --all-files
- name: Verify catalogs are committed
run: git diff --exit-code src/locales/
- name: Report untranslated strings per locale
# Informational only — does not fail the build.
run: |
echo "### Translation coverage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
TOTAL=$(grep -c '^msgid ' src/locales/en/messages.po || true)
for po in src/locales/*/messages.po; do
locale=$(basename "$(dirname "$po")")
[ "$locale" = "en" ] && continue
MISSING=$(grep -c '^msgstr ""$' "$po" 2>/dev/null || echo "file missing")
if [ "$MISSING" = "file missing" ]; then
echo "- **${locale}**: catalog missing" >> $GITHUB_STEP_SUMMARY
else
TRANSLATED=$((TOTAL - MISSING))
echo "- **${locale}**: ${TRANSLATED}/${TOTAL} strings translated" >> $GITHUB_STEP_SUMMARY
fi
done
rust:
name: Rust fmt & clippy
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
cache: npm
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: |
src-tauri
src-tauri/plugins/share-sheet
src-tauri/plugins/ios-keyboard
- name: Install Tauri system deps
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libsoup-3.0-dev \
libjavascriptcoregtk-4.1-dev
- name: Install deps
run: npm ci
- name: Run lefthook rust hooks
run: npx lefthook run pre-commit --commands rust-fmt,rust-clippy --all-files
build:
name: Build and Test
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
cache: npm
- name: Install deps
run: npm ci
- name: Test
run: npm run test