-
-
Notifications
You must be signed in to change notification settings - Fork 184
52 lines (44 loc) · 1.04 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
name: test
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16']
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup Node v${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build
- run: npm install --workspaces
- run: npm run lint
- run: npm run build
- run: npm test
- name: test-install each package in the workspace as dependency
run: |
set -u
set -o pipefail
set -x
ls -al packages
for path in packages/*; do
pkg="$(basename "$path")"
tgz="$(realpath $(npm pack -s --workspace "$pkg" | xargs))"
pushd .
cd "$(mktemp -d)"
npm init -y
npm i "$tgz"
file "$(node -p "require('$pkg')")"
"$(node -p "require('$pkg')")" -L
popd
done