-
-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (163 loc) · 5.76 KB
/
ci.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
174
175
176
name: CI
on:
push:
branches: [ master ]
pull_request:
jobs:
checksecret:
name: check if MY_SECRET is set in github secrets
runs-on: ubuntu-latest
outputs:
is_MY_SECRET_set: ${{ steps.checksecret_job.outputs.is_MY_SECRET_set }}
steps:
- name: Check whether unity activation requests should be done
id: checksecret_job
env:
MY_SECRET: ${{ secrets.GMAP_API_KEY }}
run: |
echo "is_MY_SECRET_set: ${{ env.MY_SECRET != '' }}"
echo "::set-output name=is_MY_SECRET_set::${{ env.MY_SECRET != '' }}"
integration:
env:
VUE_APP_API_KEY: YOUR_GOOGLE_MAPS_API_KEY
VUE_APP_FIREBASE_API_KEY: YOUR_FIREBASE_API_KEY
VUE_APP_FIREBASE_PROJECT_ID: YOUR_FIREBASE_PROJECT_ID
VUE_APP_FIREBASE_MESSAGING_SENDER_ID: YOUR_FIREBASE_MESSAGING_SENDER_ID
VUE_APP_FIREBASE_APP_ID: YOUR_FIREBASE_APP_ID
VUE_APP_FIREBASE_MEASUREMENT_ID: YOUR_FIREBASE_MEASUREMENT_ID
strategy:
matrix:
os: [ubuntu-latest] # , macos-latest, windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
- uses: actions/cache@v3.3.1
id: cache
if: matrix.os != 'windows-latest'
with:
path: ~/.npm
key: ${{ matrix.os }}-node-deps-${{ hashFiles('**/package-lock.json') }}
- name: Get npm cache directory
id: npm-cache
if: matrix.os == 'windows-latest'
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3.3.1
if: matrix.os == 'windows-latest'
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Linter
run: NODE_ENV=production npm run lint -- --no-fix
- name: Run unit tests
run: npm run test:unit
- name: Code coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
- name: Build
run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-node-build
path: dist
cypress-chrome-firefox-simple:
needs: [checksecret, integration]
if: needs.checksecret.outputs.is_MY_SECRET_set == 'false'
runs-on: ubuntu-latest
name: E2E Simple on Ubuntu
strategy:
fail-fast: false
matrix:
browsers: [chrome]
steps:
- uses: actions/checkout@v4
- uses: cypress-io/github-action@v6
with:
start: npm run serve
wait-on: 'http://localhost:8080'
record: true
group: ${{matrix.browsers}}
tag: ${{ github.event_name }}
browser: ${{matrix.browsers}}
spec: |
tests/e2e/specs/homePage.test.js
wait-on-timeout: 500
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cypress-chrome-firefox:
needs: [checksecret, integration]
if: needs.checksecret.outputs.is_MY_SECRET_set == 'true'
env:
VUE_APP_API_KEY: ${{ secrets.GMAP_API_KEY }}
VUE_APP_FIREBASE_API_KEY: ${{ secrets.VUE_APP_FIREBASE_API_KEY }}
VUE_APP_FIREBASE_APP_ID: ${{ secrets.VUE_APP_FIREBASE_APP_ID }}
VUE_APP_FIREBASE_AUTH_DOMAIN: ${{ secrets.VUE_APP_FIREBASE_AUTH_DOMAIN }}
VUE_APP_FIREBASE_DATABASE_URL: ${{ secrets.VUE_APP_FIREBASE_DATABASE_URL }}
VUE_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.VUE_APP_FIREBASE_MESSAGING_SENDER_ID }}
VUE_APP_FIREBASE_PROJECT_ID: ${{ secrets.VUE_APP_FIREBASE_PROJECT_ID }}
VUE_APP_STORAGE_BUCKET: ${{ secrets.VUE_APP_STORAGE_BUCKET }}
runs-on: ubuntu-latest
name: E2E on Ubuntu
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3]
browsers: [chrome]
steps:
- uses: actions/checkout@v4
- uses: cypress-io/github-action@v6
with:
start: npm run serve
wait-on: 'http://localhost:8080'
record: true
parallel: true
group: ${{matrix.browsers}}
tag: ${{ github.event_name }}
browser: ${{matrix.browsers}}
wait-on-timeout: 500
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# cypress-edge:
# needs: integration
# env:
# VUE_APP_API_KEY: ${{ secrets.GMAP_API_KEY }}
# VUE_APP_FIREBASE_API_KEY: YOUR_FIREBASE_API_KEY
# VUE_APP_FIREBASE_PROJECT_ID: YOUR_FIREBASE_PROJECT_ID
# VUE_APP_FIREBASE_MESSAGING_SENDER_ID: YOUR_FIREBASE_MESSAGING_SENDER_ID
# VUE_APP_FIREBASE_APP_ID: YOUR_FIREBASE_APP_ID
# VUE_APP_FIREBASE_MEASUREMENT_ID: YOUR_FIREBASE_MEASUREMENT_ID
# runs-on: windows-latest
# name: E2E on Windows
# strategy:
# fail-fast: false
# matrix:
# containers: [1, 2, 3, 4]
# steps:
# - name: Set git to use LF
# run: |
# git config --global core.autocrlf false
# git config --global core.eol lf
# - uses: actions/checkout@v4
# - uses: cypress-io/github-action@v2
# with:
# start: npm run serve
# wait-on: 'http://localhost:8080'
# record: true
# browser: edge
# group: edge
# parallel: true
# tag: ${{ github.event_name }}
# env:
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}