@@ -3,65 +3,62 @@ name: Package Tests
33on : [push, pull_request]
44
55jobs :
6- npm :
7- name : " @wq/${{ matrix.package }}"
8- runs-on : ubuntu-latest
9- env :
10- PACKAGE : ${{ matrix.package }}
11- strategy :
12- fail-fast : false
13- matrix :
14- python-version : ["3.14"]
15- node-version : [24]
16- package :
17- - form-common
18- - form
19- - form-web
20- - form-native
21- steps :
22- - uses : actions/checkout@v6
23- with :
24- fetch-depth : 0
25- - name : Set up Node ${{ matrix.node-version }}
26- uses : actions/setup-node@v6
27- with :
28- node-version : ${{ matrix.node-version }}
29- - name : Set up Python ${{ matrix.python-version }}
30- uses : actions/setup-python@v6
31- with :
32- python-version : ${{ matrix.python-version }}
33- - name : Install dependencies
34- run : |
35- echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
36- echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
37- npm ci && npm run build
38- - name : Install native dependencies
39- if : matrix.package == 'form-native'
40- run : |
41- cd packages/$PACKAGE
42- echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
43- echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
44- npm ci
45- - name : Lint with ESLint
46- run : npm run lint
47- - name : Start test server
48- run : python -m tests.server &
49- - name : Test with Jest
50- run : |
51- cd packages/$PACKAGE
52- npm run test
53- - uses : smartsquaregmbh/delete-old-packages@v0.4.0
54- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
55- with :
56- keep : 5
57- names : ${{ matrix.package }}
58- - name : Publish to Github Packages
59- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
60- run : |
61- python -m pip install setuptools_scm
62- ./set_dev_version.sh
63- echo "registry=https://npm.pkg.github.com/wq" > .npmrc
64- echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
65- cp .npmrc packages/$PACKAGE/.npmrc # for native builds
66- cd packages/$PACKAGE
67- npm publish --tag latest
6+ npm :
7+ name : " @wq/${{ matrix.package }}"
8+ runs-on : ubuntu-latest
9+ env :
10+ PACKAGE : ${{ matrix.package }}
11+ strategy :
12+ fail-fast : false
13+ matrix :
14+ python-version : ["3.14"]
15+ node-version : [24]
16+ package :
17+ - form-common
18+ - form
19+ - form-web
20+ - form-native
21+ steps :
22+ - uses : actions/checkout@v6
23+ with :
24+ fetch-depth : 0
25+ - name : Set up Node ${{ matrix.node-version }}
26+ uses : actions/setup-node@v6
27+ with :
28+ node-version : ${{ matrix.node-version }}
29+ - name : Set up Python ${{ matrix.python-version }}
30+ uses : actions/setup-python@v6
31+ with :
32+ python-version : ${{ matrix.python-version }}
33+ - name : Install dependencies
34+ run : npm ci && npm run build
35+ - name : Install native dependencies
36+ if : matrix.package == 'form-native'
37+ run : |
38+ cd packages/$PACKAGE
39+ echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
40+ echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
41+ - name : Lint with ESLint
42+ run : npm run lint
43+ - name : Start test server
44+ run : python -m tests.server &
45+ - name : Test with Jest
46+ run : |
47+ cd packages/$PACKAGE
48+ npm run test
49+ - uses : actions/delete-package-versions@v5
50+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
51+ with :
52+ package-type : npm
53+ package-name : ${{ matrix.package }}
54+ min-versions-to-keep : 5
55+ - name : Publish to Github Packages
56+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
57+ run : |
58+ python -m pip install setuptools_scm
59+ ./set_dev_version.sh
60+ echo "registry=https://npm.pkg.github.com/wq" > .npmrc
61+ echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
62+ cp .npmrc packages/$PACKAGE/.npmrc # for native builds
63+ cd packages/$PACKAGE
64+ npm publish --tag latest
0 commit comments