|
1 | 1 | name: test |
2 | 2 |
|
3 | | -on: [push, pull_request, workflow_dispatch] |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + debug: |
| 9 | + description: 'Set to on, to open ssh debug session.' |
| 10 | + required: true |
| 11 | + default: 'off' |
4 | 12 |
|
5 | | -jobs: |
6 | | - |
7 | | - static-analysis: |
8 | | - runs-on: ubuntu-latest |
9 | | - strategy: |
10 | | - matrix: |
11 | | - # run static analysis on bleeding and trailing edges |
12 | | - python-version: [ '3.9', '3.12' ] |
13 | | - django-version: |
14 | | - - 'Django~=3.2.0' # LTS April 2024 |
15 | | - - 'Django~=4.2.0' # LTS April 2026 |
16 | | - - 'Django~=5.0.0' |
17 | | - exclude: |
18 | | - - python-version: '3.9' |
19 | | - django-version: 'Django~=4.2.0' |
20 | | - - python-version: '3.9' |
21 | | - django-version: 'Django~=5.0.0' |
22 | | - - python-version: '3.12' |
23 | | - django-version: 'Django~=3.2.0' |
24 | | - |
25 | | - steps: |
26 | | - - uses: actions/checkout@v4 |
27 | | - - name: Set up Python ${{ matrix.python-version }} |
28 | | - uses: actions/setup-python@v5 |
29 | | - with: |
30 | | - python-version: ${{ matrix.python-version }} |
| 13 | + schedule: |
| 14 | + - cron: '0 13 * * *' # Runs at 6 am pacific every day |
31 | 15 |
|
32 | | - - name: Install Poetry |
33 | | - uses: snok/install-poetry@v1 |
34 | | - with: |
35 | | - version: 1.5.1 |
36 | | - virtualenvs-create: true |
37 | | - virtualenvs-in-project: true |
38 | | - - name: Install Dependencies |
39 | | - run: | |
40 | | - poetry config virtualenvs.in-project true |
41 | | - poetry run pip install --upgrade pip |
42 | | - poetry install -E all |
43 | | - poetry run pip install -U "${{ matrix.django-version }}" |
44 | | - - name: Run Static Analysis |
45 | | - run: | |
46 | | - poetry run black render_static --check |
47 | | - poetry run pylint render_static |
48 | | - poetry run mypy render_static |
49 | | - poetry check |
50 | | - poetry run pip check |
51 | | - poetry export --without-hashes --format=requirements.txt | poetry run safety check --stdin |
52 | | - poetry run python -m readme_renderer ./README.md -o /tmp/README.html |
53 | | - cd ./doc |
54 | | - poetry run doc8 --ignore-path build --max-line-length 100 |
| 16 | +jobs: |
55 | 17 |
|
56 | 18 | test: |
57 | 19 | runs-on: ubuntu-latest |
@@ -93,17 +55,22 @@ jobs: |
93 | 55 | poetry run pip install --upgrade pip |
94 | 56 | poetry install -E all |
95 | 57 | poetry run pip install -U "Django~=${{ matrix.django-version }}" |
| 58 | + - name: Install Emacs |
| 59 | + if: ${{ github.event.inputs.debug == 'on' }} |
| 60 | + run: | |
| 61 | + sudo apt install emacs |
| 62 | + - name: Setup tmate session |
| 63 | + if: ${{ github.event.inputs.debug == 'on' }} |
| 64 | + uses: mxschmitt/action-tmate@v3 |
| 65 | + with: |
| 66 | + detached: true |
| 67 | + timeout-minutes: 60 |
96 | 68 | - name: Run Unit Tests |
97 | 69 | run: | |
98 | 70 | poetry run pytest |
99 | 71 | poetry run pip uninstall -y jinja2 pyyaml importlib-resources |
100 | 72 | poetry run pytest --cov-append |
101 | 73 | mv .coverage py${{ matrix.python-version }}-dj${{ matrix.django-version }}.coverage |
102 | | - # - name: Setup tmate session |
103 | | - # uses: mxschmitt/action-tmate@v3 |
104 | | - # with: |
105 | | - # detached: true |
106 | | - # timeout-minutes: 60 |
107 | 74 | - name: Store coverage files |
108 | 75 | uses: actions/upload-artifact@v4 |
109 | 76 | with: |
|
0 commit comments