Skip to content

Commit 3b39cdb

Browse files
used pre-commit to lint all files
1 parent 33af5cf commit 3b39cdb

File tree

12 files changed

+8983
-8802
lines changed

12 files changed

+8983
-8802
lines changed

.github/workflows/nightly-tests.yml

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,53 @@ name: Nightly Wagtail test
22
# Inspired by: https://github.com/torchbox/wagtailmedia/blob/main/.github/workflows/nightly-tests.yml
33

44
on:
5-
schedule:
6-
# Run every Monday at midnight
7-
- cron: "0 0 * * 1"
5+
schedule:
6+
# Run every Monday at midnight
7+
- cron: '0 0 * * 1'
88

9-
workflow_dispatch:
9+
workflow_dispatch:
1010

1111
jobs:
12-
nightly-test:
13-
# Cannot check the existence of secrets, so limiting to repository name to prevent all forks to run nightly.
14-
# See: https://github.com/actions/runner/issues/520
15-
if: ${{ github.repository == 'wagtail-nest/wagtail-ab-testing' }}
16-
runs-on: ubuntu-latest
12+
nightly-test:
13+
# Cannot check the existence of secrets, so limiting to repository name to prevent all forks to run nightly.
14+
# See: https://github.com/actions/runner/issues/520
15+
if: ${{ github.repository == 'wagtail-nest/wagtail-ab-testing' }}
16+
runs-on: ubuntu-latest
1717

18-
services:
19-
postgres:
20-
image: postgres:16
21-
env:
22-
POSTGRES_USER: postgres
23-
POSTGRES_PASSWORD: postgres
24-
options: >-
25-
--health-cmd pg_isready
26-
--health-interval 10s
27-
--health-timeout 5s
28-
--health-retries 5
29-
ports:
30-
- 5432:5432
31-
steps:
32-
- uses: actions/checkout@v4
33-
with:
34-
fetch-depth: 0
35-
- uses: actions/setup-python@v5
36-
with:
37-
python-version: "3.12"
38-
- name: Install dependencies
39-
run: |
40-
python -m pip install tox requests
41-
- name: Test
42-
id: test
43-
continue-on-error: true
44-
env:
45-
DATABASE_URL: postgres://postgres:postgres@localhost/wagtail_ab_testing
46-
run: |
47-
tox -e wagtailmain-postgres,wagtailmain-sqlite
18+
services:
19+
postgres:
20+
image: postgres:16
21+
env:
22+
POSTGRES_USER: postgres
23+
POSTGRES_PASSWORD: postgres
24+
options: >-
25+
--health-cmd pg_isready
26+
--health-interval 10s
27+
--health-timeout 5s
28+
--health-retries 5
29+
ports:
30+
- 5432:5432
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
- uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.12'
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install tox requests
41+
- name: Test
42+
id: test
43+
continue-on-error: true
44+
env:
45+
DATABASE_URL: postgres://postgres:postgres@localhost/wagtail_ab_testing
46+
run: |
47+
tox -e wagtailmain-postgres,wagtailmain-sqlite
4848
49-
- name: Send Slack notification on failure
50-
if: steps.test.outcome == 'failure'
51-
run: |
52-
python .github/report_nightly_build_failure.py
53-
env:
54-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
49+
- name: Send Slack notification on failure
50+
if: steps.test.outcome == 'failure'
51+
run: |
52+
python .github/report_nightly_build_failure.py
53+
env:
54+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/publish-test.yml

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
11
name: Publish to Test PyPI
22
on:
3-
release:
4-
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
5-
types: [prereleased]
3+
release:
4+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
5+
types: [prereleased]
66
jobs:
7-
test:
8-
uses: ./.github/workflows/test.yml
9-
10-
build:
11-
needs: ['test']
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
15-
16-
- uses: actions/setup-node@v4
17-
with:
18-
node-version: 20
19-
20-
- name: Install Node dependencies
21-
run: |
22-
npm ci
23-
24-
- name: Compile JavaScript
25-
run: |
26-
npm run build
27-
28-
- uses: actions/setup-python@v5
29-
with:
30-
python-version: 3.13
31-
32-
- name: Install Python dependencies
33-
run: pip install build
34-
35-
- name: Build package distributions
36-
run: python -m build
37-
38-
- uses: actions/upload-artifact@v4
39-
with:
40-
path: ./dist
41-
42-
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
43-
pypi-publish:
44-
needs: ['build']
45-
environment: 'publish-test'
46-
47-
name: upload release to TestPyPI
48-
runs-on: ubuntu-latest
49-
permissions:
50-
# Mandatory for trusted publishing
51-
id-token: write
52-
steps:
53-
- uses: actions/download-artifact@v4
54-
55-
- name: Publish package distributions to PyPI
56-
uses: pypa/gh-action-pypi-publish@release/v1
57-
with:
58-
packages-dir: artifact/
59-
print-hash: true
60-
repository-url: https://test.pypi.org/legacy/
7+
test:
8+
uses: ./.github/workflows/test.yml
9+
10+
build:
11+
needs: ['test']
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
20+
- name: Install Node dependencies
21+
run: |
22+
npm ci
23+
24+
- name: Compile JavaScript
25+
run: |
26+
npm run build
27+
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: 3.13
31+
32+
- name: Install Python dependencies
33+
run: pip install build
34+
35+
- name: Build package distributions
36+
run: python -m build
37+
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
path: ./dist
41+
42+
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
43+
pypi-publish:
44+
needs: ['build']
45+
environment: 'publish-test'
46+
47+
name: upload release to TestPyPI
48+
runs-on: ubuntu-latest
49+
permissions:
50+
# Mandatory for trusted publishing
51+
id-token: write
52+
steps:
53+
- uses: actions/download-artifact@v4
54+
55+
- name: Publish package distributions to PyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
packages-dir: artifact/
59+
print-hash: true
60+
repository-url: https://test.pypi.org/legacy/

.github/workflows/publish.yml

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
11
name: Publish to PyPI
22
on:
3-
release:
4-
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
5-
types: [released]
3+
release:
4+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
5+
types: [released]
66
jobs:
7-
test:
8-
uses: ./.github/workflows/test.yml
9-
10-
build:
11-
needs: ['test']
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
15-
16-
- uses: actions/setup-node@v4
17-
with:
18-
node-version: 20
19-
20-
- name: Install Node dependencies
21-
run: |
22-
npm ci
23-
24-
- name: Compile JavaScript
25-
run: |
26-
npm run build
27-
28-
- uses: actions/setup-python@v5
29-
with:
30-
python-version: 3.13
31-
32-
- name: Install Python dependencies
33-
run: pip install build
34-
35-
- name: Build package distributions
36-
run: python -m build
37-
38-
- uses: actions/upload-artifact@v4
39-
with:
40-
path: ./dist
41-
42-
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
43-
pypi-publish:
44-
needs: ['build']
45-
environment: 'publish'
46-
47-
name: upload release to PyPI
48-
runs-on: ubuntu-latest
49-
permissions:
50-
# Mandatory for trusted publishing
51-
id-token: write
52-
steps:
53-
- uses: actions/download-artifact@v4
54-
55-
- name: Publish package distributions to PyPI
56-
uses: pypa/gh-action-pypi-publish@release/v1
57-
with:
58-
packages-dir: artifact/
59-
print-hash: true
7+
test:
8+
uses: ./.github/workflows/test.yml
9+
10+
build:
11+
needs: ['test']
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
20+
- name: Install Node dependencies
21+
run: |
22+
npm ci
23+
24+
- name: Compile JavaScript
25+
run: |
26+
npm run build
27+
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: 3.13
31+
32+
- name: Install Python dependencies
33+
run: pip install build
34+
35+
- name: Build package distributions
36+
run: python -m build
37+
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
path: ./dist
41+
42+
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
43+
pypi-publish:
44+
needs: ['build']
45+
environment: 'publish'
46+
47+
name: upload release to PyPI
48+
runs-on: ubuntu-latest
49+
permissions:
50+
# Mandatory for trusted publishing
51+
id-token: write
52+
steps:
53+
- uses: actions/download-artifact@v4
54+
55+
- name: Publish package distributions to PyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
packages-dir: artifact/
59+
print-hash: true

0 commit comments

Comments
 (0)