-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (131 loc) · 4.19 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
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
153
154
155
156
157
158
159
name: Pull request
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
lint:
name: Lint Rust
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup
run: |
VS="0.16.1"
NAME="cargo-deny"
curl -L -o ./archive.tar.gz https://github.com/EmbarkStudios/$NAME/releases/download/$VS/$NAME-$VS-x86_64-unknown-linux-musl.tar.gz
tar -xzvf ./archive.tar.gz --strip-components=1 -C .
- name: format
if: always()
run: cargo fmt --check
- name: check
if: always()
run: cargo check
- name: clippy
if: always()
run: cargo clippy
- name: licenses
if: always()
run: ./cargo-deny check licenses
test:
name: Test Rust
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: '1.22'
cache: false
- name: setup vips
run: sudo apt-get update && sudo apt-get install -y libvips-tools && vips --version
- name: Install fake-oidc
run: go install github.com/bradenrayhorn/fake-oidc@v0
- name: test
run: cargo test
lint-svelte:
name: Lint Svelte
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: "./ui/.nvmrc"
- name: Install dependencies
run: npm install
working-directory: ./ui
- name: Prettier and ESLint
run: npm run lint
working-directory: ./ui
if: always()
- name: svelte-check
run: npm run check -- --fail-on-warnings
working-directory: ./ui
if: always()
- name: build
run: GENERATE_LICENSES=true npm run build
working-directory: ./ui
if: always()
test-svelte:
name: Test Svelte
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: "./ui/.nvmrc"
- name: Install dependencies
run: npm install
working-directory: ./ui
- name: Vitest
run: npm run test:unit
working-directory: ./ui
if: always()
test-e2e:
name: Test E2E
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version-file: "./ui/.nvmrc"
- name: Setup go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version: '1.22'
cache: false
- name: setup vips
run: sudo apt-get update && sudo apt-get install -y libvips-tools && vips --version
- name: Install fake-oidc
run: go install github.com/bradenrayhorn/fake-oidc@v0
- name: Install Svelte dependencies
working-directory: ./ui
run: npm install
- name: Install Playwright dependencies
working-directory: ./e2e
run: npm install
- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: ./e2e
- name: Run Playwright tests
working-directory: ./e2e
run: npm run test
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: e2e/playwright-report/
retention-days: 2