-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (60 loc) · 1.97 KB
/
unit-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
name: Unit Tests
on:
push:
branches: [main]
pull_request:
branches: [main, 'dependabot/*']
types: [opened, synchronize, reopened]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 17.x, 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: yarn
- run: yarn build
- run: yarn test
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # better relevancy of analysis
- uses: actions/setup-node@v1
with:
node-version: '16'
- name: Install Dependencies
run: yarn
- name: Run Tests
run: yarn test
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # PR information
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16'
- name: Install Dependencies
run: yarn install
- name: Bring up WordPress
run: yarn docker
- name: Wait for DB import
run: |
echo 'pausing: waiting for mysql to come available'
./__tests__/e2e/wait-for-db-import.sh
echo 'un-pausing: mysql is now available'
- name: Run end-to-end test
run: yarn test:e2e
- name: Tear down WordPress
run: yarn docker:down