-
Notifications
You must be signed in to change notification settings - Fork 14
114 lines (91 loc) · 2.56 KB
/
react.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
name: RunTests
on: [push, pull_request]
jobs:
test_frontend:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: ['12', '14', '16', '17']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Cache npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: |
npm install
- name: Run format
run: |
npm run format
- name: Run eslint
run: |
npm run eslint
- name: Run tests
run: |
npm run test
test_e2e:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: ['14', '16']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Cache npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install npm dependencies
run: |
npm install
- name: Install playwright dependencies
run: |
npx playwright install --with-deps chromium
- name: Run e2e tests
run: |
npm run teste2e
deploy_frontend:
strategy:
matrix:
os: [ubuntu-latest]
node: ['16']
runs-on: ${{ matrix.os }}
needs: [test_frontend, test_e2e]
steps:
- uses: actions/checkout@v2
- name: Set up Node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Cache npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-${{ matrix.node }}-node-production-${{ hashFiles('**/package-lock.json') }}
- name: Install npm dependencies
run: |
npm install --production
- name: Build
run: |
npm run build
- name: Publish to Github Pages
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.GITHUB_PAGES_TOKEN }}
BASE_BRANCH: master # The branch the action should deploy from.
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: build # The folder the action should deploy.