CI: adapt to workspace repo structure 💚 #70
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |