include @wq/analyst in docs #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/delete-old-packages@v0.8.0 | |
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 |