-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (85 loc) · 2.52 KB
/
Copy pathtest.yml
File metadata and controls
85 lines (85 loc) · 2.52 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
name: test
on:
schedule:
- cron: "0 0 * * *"
pull_request:
types:
- opened
- synchronize
branches:
- develop
- master
jobs:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: "go.mod"
cache: false
# Scoped to src: node_modules ships a stray Go package that ./... would
# otherwise build.
- run: go vet ./src/...
- run: go test ./src/...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: ".tool-versions"
- run: npm ci
# The Playwright suite is linted with type information, which needs its
# own dependencies resolvable.
- run: npm ci
working-directory: e2e
- run: npm run lint
- name: Type-check the Playwright suite
run: npx tsc --noEmit
working-directory: e2e
styles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: ".tool-versions"
- run: npm ci
# public/app.css is committed so the binary and container need no Node.
# A rebuild that changes it means a template or script gained a class the
# committed sheet does not carry, and the running app would be missing it.
- name: Rebuild stylesheet and check it matches the committed one
run: |
npm run css
git diff --exit-code --stat public/app.css \
|| { echo "::error::public/app.css is stale. Run 'npm run css' and commit the result"; exit 1; }
e2e:
runs-on: ubuntu-latest
defaults:
run:
working-directory: e2e
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: "go.mod"
cache: false
- uses: actions/setup-node@v7
with:
node-version-file: ".tool-versions"
- name: Build server
run: CGO_ENABLED=0 go build -o ./bin/httphq ./src
working-directory: .
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report
path: e2e/playwright-report
retention-days: 7