Skip to content

Commit 1836455

Browse files
committed
Run both runtime and type tests against the dist folder during CI
1 parent 106f8fc commit 1836455

File tree

1 file changed

+56
-43
lines changed

1 file changed

+56
-43
lines changed

.github/workflows/test.yml

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
name: Tests
22

3-
on:
4-
push:
5-
branches: [master]
6-
pull_request:
7-
branches: [master]
8-
workflow_dispatch:
3+
on: [push, pull_request, workflow_dispatch]
94

105
jobs:
116
build:
12-
name: Test Suite
7+
name: Build and run test Suite
138
runs-on: ubuntu-latest
149

1510
steps:
@@ -25,6 +20,9 @@ jobs:
2520
- name: Install dependencies
2621
run: yarn install
2722

23+
- name: Run test suite
24+
run: yarn test
25+
2826
- name: Collect coverage
2927
run: yarn coverage
3028

@@ -39,42 +37,6 @@ jobs:
3937
name: package
4038
path: ./package.tgz
4139

42-
test-dist:
43-
name: Test against dist
44-
needs: [build]
45-
runs-on: ubuntu-latest
46-
strategy:
47-
fail-fast: false
48-
matrix:
49-
node: ['20.x']
50-
steps:
51-
- name: Checkout repo
52-
uses: actions/checkout@v4
53-
54-
- name: Use node ${{ matrix.node }}
55-
uses: actions/setup-node@v4
56-
with:
57-
node-version: ${{ matrix.node }}
58-
cache: 'yarn'
59-
60-
- name: Install deps
61-
run: yarn install
62-
63-
- uses: actions/download-artifact@v4
64-
with:
65-
name: package
66-
path: .
67-
68-
- run: ls -lah
69-
70-
- name: Install build artifact
71-
run: yarn add ./package.tgz
72-
73-
- run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./vitest.config.mts
74-
75-
- name: Run tests, against dist
76-
run: yarn test
77-
7840
test-types:
7941
name: Test Types with TypeScript ${{ matrix.ts }}
8042

@@ -96,12 +58,24 @@ jobs:
9658
node-version: ${{ matrix.node }}
9759
cache: 'yarn'
9860

61+
- name: Download build artifact
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: package
65+
path: .
66+
9967
- name: Install deps
10068
run: yarn install
10169

10270
- name: Install TypeScript ${{ matrix.ts }}
10371
run: yarn add typescript@${{ matrix.ts }}
10472

73+
- name: Install build artifact
74+
run: yarn add ./package.tgz
75+
76+
- name: Erase path aliases
77+
run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./vitest.config.mts
78+
10579
- name: Test types
10680
run: |
10781
yarn tsc --version
@@ -252,3 +226,42 @@ jobs:
252226

253227
- name: Build example
254228
run: yarn build
229+
230+
test-dist:
231+
name: Run local tests against build artifact
232+
needs: [build]
233+
runs-on: ubuntu-latest
234+
strategy:
235+
fail-fast: false
236+
matrix:
237+
node: ['20.x']
238+
steps:
239+
- name: Checkout repo
240+
uses: actions/checkout@v4
241+
242+
- name: Use node ${{ matrix.node }}
243+
uses: actions/setup-node@v4
244+
with:
245+
node-version: ${{ matrix.node }}
246+
cache: 'yarn'
247+
248+
- name: Install deps
249+
run: yarn install
250+
251+
- name: Download build artifact
252+
uses: actions/download-artifact@v4
253+
with:
254+
name: package
255+
path: .
256+
257+
- name: Check folder contents
258+
run: ls -lah
259+
260+
- name: Install build artifact
261+
run: yarn add ./package.tgz
262+
263+
- name: Erase path aliases
264+
run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./vitest.config.mts
265+
266+
- name: Run local tests against the build artifact
267+
run: yarn test

0 commit comments

Comments
 (0)