-
Notifications
You must be signed in to change notification settings - Fork 27
106 lines (90 loc) · 2.47 KB
/
main.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
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
env:
FORCE_COLOR: 2
jobs:
unit-test-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn
- name: Install
run: yarn install
- name: Lint
run: |
yarn run lint
- name: Test
run: |
yarn run coverage:unit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/clover.xml
name: '${{ github.job }}'
flags: unittests
fail_ci_if_error: false
- name: Build
run: yarn run build
- name: Check browser compatibility
run: yarn run lint:compat
cypress-run:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
browser: [firefox, chrome]
type: [e2e, component]
# TODO: re-enable once macos build is stable #590
# include:
# - os: macos-latest
# browser: edge
env:
COVERAGE: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Test (E2E)
if: matrix.type == 'e2e'
uses: cypress-io/github-action@v6
env:
BASE_URL: http://localhost:4173/
with:
build: yarn run build --mode offline
start: yarn run preview
config: baseUrl=${{ env.BASE_URL }}
wait-on: ${{ env.BASE_URL }}
browser: ${{ matrix.browser }}
- name: Test (component)
if: matrix.type == 'component'
uses: cypress-io/github-action@v6
with:
component: true
browser: ${{ matrix.browser }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: tests/e2e/screenshots
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
name: '${{ github.job }} ${{ matrix.os }} ${{ matrix.browser }} ${{ matrix.type }}'
flags: ${{ matrix.type }}
fail_ci_if_error: false