Skip to content

Commit 5683458

Browse files
committed
Split vite and storybook test actions
1 parent d051662 commit 5683458

File tree

1 file changed

+46
-3
lines changed

1 file changed

+46
-3
lines changed

.github/workflows/ci.yml

+46-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ on:
1111
- develop
1212

1313
jobs:
14-
test:
14+
test-vite:
1515
runs-on: ubuntu-latest
16-
name: Test
16+
name: Test Vite
1717

1818
strategy:
1919
matrix:
@@ -37,11 +37,54 @@ jobs:
3737
run: npm install
3838

3939
- name: Test
40-
run: CI=true npm run test
40+
run: CI=true npm run test-vite
4141

4242
- name: Upload code coverage to Codecov
4343
uses: codecov/codecov-action@v3
4444

45+
test-storybook:
46+
runs-on: ubuntu-latest
47+
name: Test Storybook
48+
49+
strategy:
50+
matrix:
51+
node-version: [19.x]
52+
53+
steps:
54+
- name: Checkout repository
55+
uses: actions/checkout@v3
56+
57+
- name: Set up Node.js ${{ matrix.node-version }}
58+
uses: actions/setup-node@v3
59+
60+
- name: Cache dependencies
61+
uses: actions/cache@v3
62+
with:
63+
path: |
64+
**/node_modules
65+
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
66+
67+
- name: Install dependencies
68+
run: npm install
69+
70+
- name: Install Playwright
71+
run: npx playwright install
72+
73+
- name: Wait for the Netlify Preview
74+
uses: kamranayub/[email protected]
75+
id: waitForNetlify
76+
with:
77+
site_name: 'niaefeup-frontend-storybook'
78+
max_timeout: 300 # 5 minutes
79+
env:
80+
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
81+
82+
- name: Test
83+
run: npm run test-storybook -- --url ${{ steps.waitForNetlify.outputs.url }} --ci
84+
85+
- name: Upload code coverage to Codecov # TODO: Check if codecov works with storybook
86+
uses: codecov/codecov-action@v3
87+
4588
lint:
4689
runs-on: ubuntu-latest
4790
name: Lint

0 commit comments

Comments
 (0)