-
Notifications
You must be signed in to change notification settings - Fork 16
128 lines (100 loc) · 3.66 KB
/
test.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
name: test
on: push
jobs:
# Temporarily commented out, until we set up a suitable e2e environment for running GitHub actions
# e2e:
# runs-on: ubuntu-latest
# environment: e2e
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 18
# cache: 'npm'
# - name: Install Dependencies
# run: rm package-lock.json && npm install
# - name: Build Dataverse Design System
# working-directory: packages/design-system
# run: npm run build
# - name: Create and populate .env file
# env:
# DATAVERSE_BACKEND_URL: ${{ secrets.DATAVERSE_BACKEND_URL }}
# run: |
# touch .env
# echo VITE_DATAVERSE_BACKEND_URL="$DATAVERSE_BACKEND_URL" >> .env
# shell: bash
# - name: Cypress run
# uses: cypress-io/github-action@v4
# with:
# build: npm run build
# start: npm run preview
# wait-on: 'npx wait-on --timeout 60000 http://localhost:5173'
component:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Create .npmrc
run: |
cp .npmrc.example .npmrc
sed -i -e 's/<YOUR_GITHUB_AUTH_TOKEN>/${{ secrets.GITHUB_TOKEN }}/g' .npmrc
- name: Install Dependencies
run: rm package-lock.json && npm install
- name: Build Dataverse Design System
working-directory: packages/design-system
run: npm run build
- name: Cypress run
uses: cypress-io/github-action@v4
with:
component: true
- name: Cypress run Design System
uses: cypress-io/github-action@v4
with:
project: packages/design-system
component: true
- name: Check coverage
run: npm run test:coverage-all
- name: Merge coverage
run: npm run test:coverage-merge
- name: Upload coverage report to Coveralls
if: always()
uses: coverallsapp/github-action@v2
with:
path-to-lcov: './merged-coverage/lcov.info'
github-token: ${{ secrets.GITHUB_TOKEN }}
interaction-and-accessibility:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: Create .npmrc
run: |
cp .npmrc.example .npmrc
sed -i -e 's/<YOUR_GITHUB_AUTH_TOKEN>/${{ secrets.GITHUB_TOKEN }}/g' .npmrc
- name: Install Dependencies
run: rm package-lock.json && npm install
- name: Build Dataverse Design System
working-directory: packages/design-system
run: npm run build
- name: Build Storybook Design System
working-directory: packages/design-system
run: npm run build-storybook --quiet
- name: Serve Storybook Design System and run tests
working-directory: packages/design-system
run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --port 6006 --silent" \
"npx wait-on http://127.0.0.1:6006 --l && npx test-storybook --url http://127.0.0.1:6006"
- name: Build Storybook
run: npm run build-storybook --quiet
- name: Serve Storybook and run tests
run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --port 6006 --silent" \
"npx wait-on http://127.0.0.1:6006 --l && npx test-storybook --url http://127.0.0.1:6006"