This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 148
88 lines (73 loc) · 2.35 KB
/
ci.yaml
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
name: CI
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node_modules cache
uses: actions/cache@v1
env:
cache-name: yarn
with:
path: .yarn
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Install yarn
run: hash yarn 2>/dev/null || curl -s -L https://yarnpkg.com/install.sh | sudo node
- name: Install dependencies and build packages
run: |
yarn config set cache-folder $(pwd)/.yarn
yarn install --frozen-lockfile
yarn run build
- name: Run unit tests
run: yarn test:unit --coverage
- uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage/
e2e:
name: E2E tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node_modules cache
uses: actions/cache@v1
env:
cache-name: yarn
with:
path: .yarn
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Setup node_modules cache for fixtures
uses: actions/cache@v1
env:
cache-name: fixtures
with:
path: examples/.yarn
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('examples/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Install yarn
run: hash yarn 2>/dev/null || curl -s -L https://yarnpkg.com/install.sh | sudo node
- name: Install dependencies and build packages
run: |
yarn config set cache-folder $(pwd)/.yarn
yarn install --frozen-lockfile
yarn run build
- name: Install dependencies of fixtures
run: |
cd examples
yarn config set cache-folder $(pwd)/.yarn
yarn install --frozen-lockfile
- name: Run e2e tests
run: yarn test:e2e