-
Notifications
You must be signed in to change notification settings - Fork 53
172 lines (167 loc) · 5.32 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Tests
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.variant }} ${{ matrix.backend }} py=${{ matrix.python-version }} dj=${{ matrix.django-version }} drf=${{ matrix.drf-version }}
runs-on: ubuntu-22.04
env:
TEST_VARIANT: ${{ matrix.variant }}
TEST_BACKEND: ${{ matrix.backend }}
strategy:
matrix:
python-version: ["3.11"]
django-version: [4.2.2]
drf-version: [3.14.0]
variant: ['']
backend: [threading, immediate, celery]
include:
# Alternate configurations
- python-version: "3.11"
django-version: 4.2.2
drf-version: 3.14.0
variant: wq.db
backend: threading
- python-version: "3.11"
django-version: 4.2.2
drf-version: 3.14.0
variant: reversion
backend: threading
- python-version: "3.11"
django-version: 4.2.2
drf-version: 3.14.0
variant: customlog
backend: threading
- python-version: "3.11"
django-version: 4.2.2
drf-version: 3.14.0
variant: broken
backend: threading
# Older Django versions
- python-version: "3.11"
django-version: 4.1.9
drf-version: 3.14.0
variant: ''
backend: threading
- python-version: "3.11"
django-version: 3.2.19
drf-version: 3.14.0
variant: ''
backend: threading
# Older Python versions
- python-version: "3.10"
django-version: 4.2.2
drf-version: 3.14.0
variant: ''
backend: threading
- python-version: 3.9
django-version: 4.2.2
drf-version: 3.14.0
variant: ''
backend: threading
- python-version: 3.8
django-version: 4.2.2
drf-version: 3.14.0
variant: ''
backend: threading
- python-version: 3.7
django-version: 3.2.19
drf-version: 3.14.0
variant: ''
backend: threading
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
python -m pip install flake8 wheel
python -m pip install django==${{ matrix.django-version }}
python -m pip install djangorestframework==${{ matrix.drf-version }}
python -m pip install natural-keys html-json-forms itertable
- name: Install celery & redis
if: ${{ matrix.backend == 'celery' }}
run: python -m pip install celery redis
- name: Install wq.db
if: ${{ matrix.variant == 'wq.db' }}
run: python -m pip install git+https://github.com/wq/wq.db.git
- name: Install reversion
if: ${{ matrix.variant == 'reversion' }}
run: python -m pip install django-reversion
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Start celery daemon
if: ${{ matrix.backend == 'celery' }}
run: |
python -c "import tests"
celery -A tests worker &
- name: Test with unittest
if: ${{ matrix.variant != 'broken' }}
run: python -m unittest discover -s tests -t . -v
- name: Test broken URL message
if: ${{ matrix.variant == 'broken' }}
run: |
set +e
python -m unittest discover -s tests -t . -v
test $? -eq 1
- name: Test build
run: python -m build
npm:
name: "@wq/${{ matrix.package }}"
runs-on: ubuntu-22.04
env:
PACKAGE: ${{ matrix.package }}
strategy:
matrix:
python-version: [3.11]
node-version: [18]
package:
- progress
- progress-element
- wizard
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: npm ci
- name: Lint with ESLint
run: npm run lint
- name: Test with Jest
run: |
cd packages/$PACKAGE
npm run test
- uses: smartsquaregmbh/[email protected]
if: github.event_name == 'push'
with:
keep: 5
names: ${{ matrix.package }}
- name: Publish to Github Packages
if: github.event_name == 'push'
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
cd packages/$PACKAGE
npm publish