-
-
Notifications
You must be signed in to change notification settings - Fork 50
173 lines (170 loc) · 4.79 KB
/
tests.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: node tests
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CI: "true"
jobs:
commitlint:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: install
run: |
corepack enable
pnpm i --frozen-lockfile
env:
CYPRESS_INSTALL_BINARY: 0
- name: unit test
run: |
pnpm test:unit
- name: lint
run: |
pnpm lint
- name: types
run: |
pnpm test:ts
ct:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-22.13.0-chrome-131.0.6778.264-1-ff-134.0-edge-131.0.2903.112-1
options: --user 1001
strategy:
matrix:
container: [1, 2, 3, 4]
browser: [firefox, chrome]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Deps
run: |
corepack enable
pnpm i --frozen-lockfile
- name: Run Cypress
uses: cypress-io/github-action@v6
with:
component: true
install: false
record: true
parallel: true
group: ${{ matrix.browser }}-ct
ci-build-id: "${{github.sha}}-${{ github.workflow }}-${{ github.event_name }}"
browser: ${{ matrix.browser}}
command-prefix: "pnpm"
env:
CYPRESS_RECORD_KEY: 0af1d817-e8ac-4c69-ac15-c0da1e69182d
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
e2e:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-22.13.0-chrome-131.0.6778.264-1-ff-134.0-edge-131.0.2903.112-1
options: --user 1001
strategy:
matrix:
container: [1, 2, 3, 4]
browser: [firefox, chrome]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Deps
run: |
corepack enable
pnpm i --frozen-lockfile
- name: Run Cypress
uses: cypress-io/github-action@v6
with:
install: false
record: true
parallel: true
build: pnpm build
group: ${{ matrix.browser }}
ci-build-id: "${{github.sha}}-${{ github.workflow }}-${{ github.event_name }}"
start: pnpm vinxi start
wait-on: http://localhost:9042
browser: ${{ matrix.browser}}
command-prefix: "percy exec --parallel -- pnpm"
env:
PERCY_TOKEN: web_63aaa4d04fb56e5bb41b4547417eac37310a4b8dd2ef6f2e6e444215eacb01b3
PERCY_BROWSER_EXECUTABLE: /usr/bin/google-chrome
CYPRESS_RECORD_KEY: 0af1d817-e8ac-4c69-ac15-c0da1e69182d
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PORT: 9042
NODE_ENV: production
TEST_RUN: 1
finalizePercy:
runs-on: ubuntu-latest
needs:
- e2e
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: finalize percy
run: |
corepack enable
pnpm i --frozen-lockfile
pnpm percy build:finalize
env:
PERCY_TOKEN: web_63aaa4d04fb56e5bb41b4547417eac37310a4b8dd2ef6f2e6e444215eacb01b3
docker:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: docker
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: marudor/bahn.expert/standalone
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
platforms: linux/amd64,linux/arm64
tags: "latest,${{ github.sha }}"
createDeploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- docker
- e2e
- node
- ct
steps:
- name: "Create Deployment"
uses: avakar/create-deployment@v1.0.2
with:
ref: ${{ github.sha }}
task: deploy
environment: beta
required_contexts: docker
payload: '{"value_files": ["./config/_common.yml","./config/beta.yml"],"release": "bahn-expert-beta","namespace": "marudor","track": "stable"}'
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }}