-
Notifications
You must be signed in to change notification settings - Fork 125
120 lines (118 loc) · 3.89 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
name: Tests
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.variant }} py=${{ matrix.python-version }} dj=${{ matrix.django-version }} drf=${{ matrix.drf-version }} pandas=${{ matrix.pandas-version }}
runs-on: ubuntu-22.04
env:
TEST_VARIANT: ${{ matrix.variant }}
strategy:
matrix:
python-version: ["3.12", "3.11", "3.10"]
django-version: [5.0.3]
drf-version: [3.15.1]
pandas-version: [2.2.1]
variant: ['']
include:
- python-version: "3.12"
django-version: 5.0.3
drf-version: 3.15.1
pandas-version: 2.2.1
variant: matplotlib
- python-version: "3.12"
django-version: 5.0.3
drf-version: 3.15.1
pandas-version: 2.2.1
variant: django-pandas
- python-version: "3.9"
django-version: 4.2.11
drf-version: 3.14.0
pandas-version: 1.5.3
variant: ''
- python-version: "3.8"
django-version: 4.2.11
drf-version: 3.14.0
pandas-version: 1.5.3
variant: ''
steps:
- uses: actions/checkout@v4
- 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 setuptools
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 pandas==${{ matrix.pandas-version }}
python -m pip install itertable[oldexcel]
- name: Install matplotlib
if: ${{ matrix.variant == 'matplotlib' }}
run: python -m pip install matplotlib
- name: Install django-pandas
if: ${{ matrix.variant == 'django-pandas' }}
run: python -m pip install django-pandas
- 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: Test with unittest
run: python -m unittest discover -s tests -t . -v
- 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.12"]
node-version: [20]
package:
- pandas
- chart
- analyst
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
npm ci
npm run build
- 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:
type: npm
organization: wq
names: ${{ matrix.package }}
keep: 5
- 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