-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (56 loc) · 1.77 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
name: Test
on:
push:
branches: [main]
pull_request:
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
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
id: setup-python
with:
python-version: ${{ matrix.python }}
- uses: snok/install-poetry@v1
with:
version: '1.8.3'
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 tox
- run: poetry build