-
Notifications
You must be signed in to change notification settings - Fork 365
153 lines (153 loc) · 4.78 KB
/
frontend-verify.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
---
name: "Frontend Lint & Compile check"
on:
push:
paths:
- "frontend/**"
pull_request:
paths:
- "frontend/**"
jobs:
lint-and-compile:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
working-directory: frontend
run: npm ci
- name: Run lint
working-directory: frontend
run: npm run lint
- name: Run typecheck
working-directory: frontend
run: npm run type:check
- name: Run build frontend
working-directory: frontend
run: |
REACT_APP_CONSOLE_GIT_SHA=$(echo $GITHUB_SHA | cut -c 1-6)
REACT_APP_CONSOLE_GIT_REF=$GITHUB_REF_NAME
REACT_APP_BUILD_TIMESTAMP=$(date +%s)
REACT_APP_DEV_HINT=true
npm run build
integration-test:
needs: "lint-and-compile"
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
working-directory: frontend
run: npm ci
- name: Run integration tests
working-directory: frontend
run: npm run test
e2e-test:
needs: "lint-and-compile"
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Docker compose up
working-directory: frontend
run: /usr/bin/docker compose --file tests/config/docker-compose.yaml up --detach
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
cache-dependency-path: backend/go.sum
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Install Playwright browsers
working-directory: frontend
run: npm run install:browsers
- name: Install Go dependencies
working-directory: backend/cmd/api
run: go get .
- name: Build Go server
working-directory: backend/cmd/api
run: go build -v ./...
- name: Log networks
if: runner.debug == '1'
continue-on-error: true
run: docker network ls
- name: Network inspect
if: runner.debug == '1'
continue-on-error: true
run: docker network inspect redpanda-e2e_redpanda_network
- name: Log redpanda
if: runner.debug == '1'
continue-on-error: true
run: docker logs redpanda
- name: Log owlshop
if: runner.debug == '1'
continue-on-error: true
run: docker logs owlshop
- name: Log connect
if: runner.debug == '1'
continue-on-error: true
run: docker logs connect
- name: Run Playwright tests
working-directory: frontend
run: npm run e2e-test
- name: Upload Playwright report artifact
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: playwright-report
path: frontend/playwright-report/
retention-days: 1