-
-
Notifications
You must be signed in to change notification settings - Fork 104
100 lines (83 loc) · 2.28 KB
/
build.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
name: build
on:
workflow_call:
jobs:
build:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ "20.12.0" ]
go-version: [ "1.22" ]
db-host:
- 127.0.0.1
services:
postgres:
image: postgres:15
ports:
- 5432:5432
env:
POSTGRES_DB: "thunderdome"
POSTGRES_USER: "thor"
POSTGRES_PASSWORD: "odinson"
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: |
ui/package-lock.json
e2e/package-lock.json
- run: npm ci --no-optional
working-directory: ui
- run: npm run build
working-directory: ui
env:
CI: true
- name: Get dependencies
run: |
go mod download
- name: Build
run: go build -v .
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
ui/dist
docs/swagger
- name: Run Thunderdome application
run: ./thunderdome-planning-poker &
env:
DB_HOST: ${{ matrix.db-host }}
APP_DOMAIN: ".127.0.0.1"
COOKIE_SECURE: "false"
- name: Install Playwright dependencies
working-directory: ./e2e
run: |
npm ci
npx playwright install --with-deps
- name: Run Playwright tests
working-directory: ./e2e
run: npx playwright test
env:
DB_HOST: ${{ matrix.db-host }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: e2e/playwright-report/
retention-days: 30