fieldsets are now inputs #93
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 }} ${{ 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 |