forked from marudor/bahn.expert
-
Notifications
You must be signed in to change notification settings - Fork 1
148 lines (145 loc) · 4 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
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@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v1
node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js 16
uses: actions/setup-node@master
with:
node-version: 16
- name: install
run: |
yarn --immutable --immutable-cache
env:
CYPRESS_INSTALL_BINARY: 0
- name: jest
run: |
yarn test:jest
- name: lint
run: |
yarn all:lint
- name: types
run: |
yarn test:ts
e2e:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node12.13.0-chrome80-ff74
options: --user 1001
strategy:
matrix:
container: [1, 2, 3, 4]
browser: [firefox, chrome]
fail-fast: false
steps:
- uses: actions/checkout@master
- name: Use Node.js 16
uses: actions/setup-node@master
with:
node-version: 16
- name: browser versions
run: |
firefox --version
google-chrome --version
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@master
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('package.json') }}
- name: Install Deps
run: |
yarn --immutable --immutable-cache
- name: Run Cypress
uses: cypress-io/github-action@v2
with:
install: false
record: true
parallel: true
build: yarn all:build
group: ${{ matrix.browser }}
ci-build-id: '${{github.sha}}-${{ github.workflow }}-${{ github.event_name }}'
start: node packages/server/index.js
wait-on: http://localhost:9042
browser: ${{ matrix.browser}}
env:
CYPRESS_RECORD_KEY: 0af1d817-e8ac-4c69-ac15-c0da1e69182d
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_URL: localhost:9042
NODE_ENV: production
BABEL_ENV: testProduction
TEST_RUN: 1
bundleSize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 16
uses: actions/setup-node@master
with:
node-version: 16
- name: install
run: |
yarn --immutable --immutable-cache
env:
CYPRESS_INSTALL_BINARY: 0
- name: bundleSize
run: yarn build:client:ci
env:
NODE_ENV: production
PT_PROJECT_TOKEN: a7f6dae0-81aa-496b-aeb4-8ffebdc28646
PT_BRANCH: ${{github.head_ref || github.ref}}
PT_COMMIT: ${{github.event.pull_request.head.sha || github.sha}}
docker:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v1
- name: docker
uses: elgohr/Publish-Docker-Github-Action@master
env:
DOCKER_BUILDKIT: 1
with:
name: marudor/bahnhofsabfahrten/standalone:${{ github.sha }}
username: marudor
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
snapshot: 'true'
createDeploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- docker
- e2e
- node
steps:
- name: 'Create Deployment'
uses: avakar/[email protected]
with:
ref: ${{ github.sha }}
task: deploy
environment: beta
required_contexts: docker,node
payload: '{"value_files": ["./config/beta.yml","./config/_common.yml"],"release": "bahnhofs-abfahrten-beta","namespace": "marudor","track": "stable"}'
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }}