WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 0a2dbd3

Browse files
authored
Merge pull request #1405 from olaservo/add-jest-setup
Add path utils and test config for filesystem
2 parents bd164d9 + 3928709 commit 0a2dbd3

File tree

6 files changed

+6021
-1479
lines changed

6 files changed

+6021
-1479
lines changed

.github/workflows/typescript.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,43 @@ jobs:
2222
PACKAGES=$(find . -name package.json -not -path "*/node_modules/*" -exec dirname {} \; | sed 's/^\.\///' | jq -R -s -c 'split("\n")[:-1]')
2323
echo "packages=$PACKAGES" >> $GITHUB_OUTPUT
2424
25-
build:
25+
test:
2626
needs: [detect-packages]
27+
strategy:
28+
matrix:
29+
package: ${{ fromJson(needs.detect-packages.outputs.packages) }}
30+
name: Test ${{ matrix.package }}
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: actions/setup-node@v4
36+
with:
37+
node-version: 22
38+
cache: npm
39+
40+
- name: Install dependencies
41+
working-directory: src/${{ matrix.package }}
42+
run: npm ci
43+
44+
- name: Check if tests exist
45+
id: check-tests
46+
working-directory: src/${{ matrix.package }}
47+
run: |
48+
if npm run test --silent 2>/dev/null; then
49+
echo "has-tests=true" >> $GITHUB_OUTPUT
50+
else
51+
echo "has-tests=false" >> $GITHUB_OUTPUT
52+
fi
53+
continue-on-error: true
54+
55+
- name: Run tests
56+
if: steps.check-tests.outputs.has-tests == 'true'
57+
working-directory: src/${{ matrix.package }}
58+
run: npm test
59+
60+
build:
61+
needs: [detect-packages, test]
2762
strategy:
2863
matrix:
2964
package: ${{ fromJson(needs.detect-packages.outputs.packages) }}

0 commit comments

Comments
 (0)