-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (117 loc) · 4.01 KB
/
PRtests.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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Run Tests
on:
pull_request:
branches: [ main ]
env:
CI: true
VITE_APP_FIREBASE_PROJECT_ID: ${{ secrets.VITE_APP_FIREBASE_PROJECT_ID }}
VITE_APP_FIREBASE_API_KEY: ${{ secrets.VITE_APP_FIREBASE_API_KEY }}
VITE_APP_FIREBASE_AUTH_DOMAIN: ${{ secrets.VITE_APP_FIREBASE_AUTH_DOMAIN }}
VITE_APP_FIREBASE_DATABASE_URL: ${{ secrets.VITE_APP_FIREBASE_DATABASE_URL }}
VITE_APP_FIREBASE_STORAGE_BUCKET: ${{ secrets.VITE_APP_FIREBASE_STORAGE_BUCKET }}
VITE_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.VITE_APP_FIREBASE_MESSAGING_SENDER_ID }}
VITE_APP_FIREBASE_APP_ID: ${{ secrets.VITE_APP_FIREBASE_APP_ID }}
VITE_APP_GOOGLE_ANALYTICS_ID: ${{ secrets.VITE_APP_GOOGLE_ANALYTICS_ID }}
VITE_APP_I18N_LOCALE: en
VITE_APP_I18N_FALLBACK_LOCALE: en
# FIREBASE_TOKEN: ${{ secrets.CI_FIREBASE_TOKEN }}
jobs:
# linting:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [18.x]
# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - run: npm install -g pnpm @vue/cli
# - run: pnpm install
# # - run: pnpm lint
cypress-run:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: latest
# - name: Setup NPM
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - run: npm install -g pnpm
# - run: pnpm install
- name: Cypress run
uses: cypress-io/[email protected]
with:
build: pnpm i
start: pnpm fb:dev
wait-on: "http://localhost:5173"
browser: chrome
record: true
parallel: true
group: "UI - Chrome"
env:
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG: "cypress:server:args"
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g pnpm @vue/cli
- run: pnpm install
- run: CI=true pnpm test:unit
deploy-pr-branch:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g pnpm @vue/cli
- run: pnpm install
- run: pnpm build
- name: Deploy to Firebase Hosting - PR Channel
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_QUESTLISTS }}'
projectId: questlists
# end2end-tests:
# needs: linting
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [15.x] # only use 10, for firebase-tools compatibility
# steps:
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - run: npm install -g yarn @vue/cli
# - run: yarn
# - run: CI=true yarn ci:e2e