-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (127 loc) · 4.46 KB
/
Copy pathcheck.yml
File metadata and controls
146 lines (127 loc) · 4.46 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
name: Check
on:
push:
branches: ['main', 'master']
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-typecheck-rust:
runs-on: [self-hosted, medium]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup persistent cargo target dir
run: |
# Use persistent target dir outside workspace so it survives between different repo checkouts
echo "CARGO_TARGET_DIR=$HOME/.cache/cargo-target/marlin-check" >> $GITHUB_ENV
mkdir -p "$HOME/.cache/cargo-target/marlin-check"
- name: Detect files requiring checks
id: changes
uses: dorny/paths-filter@v4
with:
filters: |
check:
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- 'tsconfig.node.json'
- 'eslint.config.cjs'
- 'vite.config.ts'
- 'vitest.config.ts'
- 'scripts/**'
- 'src/**'
- 'src-tauri/**'
- '.github/workflows/check.yml'
- name: Skip checks
if: steps.changes.outputs.check != 'true'
run: echo "No relevant changes detected. Skipping lint/typecheck/rust checks."
- name: Install Rust toolchain
if: steps.changes.outputs.check == 'true'
uses: dtolnay/rust-toolchain@stable
- name: Install system dependencies (Ubuntu)
if: runner.os == 'Linux' && steps.changes.outputs.check == 'true'
run: |
apt_retry() {
for attempt in 1 2 3 4 5 6 7 8 9 10 11 12; do
if sudo DEBIAN_FRONTEND=noninteractive apt-get "$@"; then
return 0
fi
echo "apt-get $* failed on attempt $attempt; retrying in 10s..." >&2
sleep 10
done
sudo DEBIAN_FRONTEND=noninteractive apt-get "$@"
}
apt_retry update
apt_retry install -y \
build-essential \
clang \
curl \
wget \
file \
xdg-utils \
libssl-dev \
libclang-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
pkg-config \
patchelf \
libglib2.0-bin \
libgdk-pixbuf2.0-bin \
desktop-file-utils \
shared-mime-info \
gperf
apt_retry install -y libwebkit2gtk-4.1-dev || apt_retry install -y libwebkit2gtk-4.0-dev
- name: Install dependencies
if: steps.changes.outputs.check == 'true'
run: npm ci
- name: Create SMB sidecar placeholders
if: steps.changes.outputs.check == 'true'
run: |
# Create placeholder files for all platforms to satisfy tauri-build
# These are overwritten with real binaries during release builds
mkdir -p src-tauri/binaries
touch src-tauri/binaries/marlin-smb-x86_64-unknown-linux-gnu
touch src-tauri/binaries/marlin-smb-aarch64-unknown-linux-gnu
touch src-tauri/binaries/marlin-smb-x86_64-apple-darwin
touch src-tauri/binaries/marlin-smb-aarch64-apple-darwin
- name: Run checks
if: steps.changes.outputs.check == 'true'
run: npm run check
e2e-tests:
runs-on: [self-hosted, medium]
steps:
- uses: actions/checkout@v6
- name: Detect files requiring e2e tests
id: changes
uses: dorny/paths-filter@v4
with:
filters: |
e2e:
- 'src/**'
- 'e2e/**'
- 'playwright.config.ts'
- 'package.json'
- '.github/workflows/check.yml'
- name: Skip e2e tests
if: steps.changes.outputs.e2e != 'true'
run: echo "No relevant changes detected. Skipping e2e tests."
- name: Install dependencies
if: steps.changes.outputs.e2e == 'true'
run: npm ci
- name: Install Playwright browsers
if: steps.changes.outputs.e2e == 'true'
run: npx playwright install chromium
- name: Run e2e tests
if: steps.changes.outputs.e2e == 'true'
run: npm run test:e2e
- name: Upload test results
if: failure() && steps.changes.outputs.e2e == 'true'
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: playwright-report/
retention-days: 7