Repository navigation
88 lines (72 loc) · 2.51 KB
/
Copy pathci.yml
File metadata and controls
88 lines (72 loc) · 2.51 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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
# ── Go: unit and integration tests ─────────────────────────────────────────
go-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "stable"
cache-dependency-path: flux/go.sum
- name: Vet
working-directory: flux
run: go vet ./...
- name: Check formatting
working-directory: flux
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "These files are not gofmt-clean:"
echo "$unformatted"
exit 1
fi
- name: Test
working-directory: flux
run: go test ./... -timeout 5m
# ── Frontend: tests, typecheck and production build ───────────────────────
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: flux/frontend/package-lock.json
- name: Install dependencies
working-directory: flux/frontend
run: npm ci
- name: Test
working-directory: flux/frontend
run: npm test
- name: Typecheck
working-directory: flux/frontend
run: npx tsc --noEmit
- name: Production build
working-directory: flux/frontend
run: npm run build:web
# ── OAuth 2.0 against a real provider ────────────────────────────────────
# The oauth2 engine is the part of reqit most likely to break silently: a
# change that keeps every unit test green can still fail a real provider.
# These tests drive a real Keycloak in Docker through every grant type.
oauth2-keycloak:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "stable"
cache-dependency-path: flux/go.sum
- name: Run the OAuth 2.0 suite against Keycloak
working-directory: flux
env:
TEST_KEYCLOAK_DOCKER: "1"
# Each test starts its own Keycloak container, so this takes a while.
run: go test ./internal/oauth2/ -run TestKeycloak -count=1 -v -timeout 20m