Skip to content

Use snapshot tests instead of HTML fixtures #69

Use snapshot tests instead of HTML fixtures

Use snapshot tests instead of HTML fixtures #69

Workflow file for this run

name: Test
on:
push:
branches: [main]
pull_request:
env:
PYTHON_VERSION: '3.10'
jobs:
test_node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- id: npm-cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('.nvmrc') }}-${{ hashFiles('**/package-lock.json') }}
- if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- run: npm run lint:js
- run: npm run lint:format
- run: npm run build
- run: npm run report:package
test_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
id: setup-python
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: snok/install-poetry@v1
with:
version: '1.1.13'
virtualenvs-create: true
virtualenvs-in-project: true
- id: poetry-cache
uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- if: steps.poetry-cache.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- run: poetry run flake8 tbxforms tests
- run: poetry run isort tbxforms tests --check-only --diff
- run: poetry run black tbxforms tests --check
# Enforce strict formatting on the snapshots
- run: poetry run djlint --check tests
# Lint the project's templates
- run: poetry run djlint tbxforms
- run: poetry run pytest
- run: poetry build