-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (57 loc) · 1.79 KB
/
Copy pathtest.yml
File metadata and controls
59 lines (57 loc) · 1.79 KB
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
53
54
55
56
57
58
59
name: Package Tests
on: [push, pull_request]
jobs:
npm:
name: "@wq/${{ matrix.package }}"
runs-on: ubuntu-20.04
env:
PACKAGE: ${{ matrix.package }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
node-version: [18]
package:
- model
- outbox
- store
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
echo "registry=https://npm.pkg.github.com/wq" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
npm ci && npm run build
- name: Lint with ESLint
run: npm run lint
- name: Start test server
run: python -m tests.server &
- name: Test with Jest
run: |
cd packages/$PACKAGE
npm run test
- uses: smartsquaregmbh/delete-old-packages@v0.4.0
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
keep: 5
names: ${{ matrix.package }}
- name: Publish to Github Packages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
python -m pip install setuptools_scm
./set_dev_version.sh
echo "registry=https://npm.pkg.github.com/wq" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
cp .npmrc packages/$PACKAGE/.npmrc # for native builds
cd packages/$PACKAGE
npm publish