-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix readme and project links * Set up Github Actions with tox * We don't support py38 * Fix pytest configuration * No need to install package to run tox * Fix tox version mapping for Github Actions * Test Django 4.2 with more Python versions * Fix nightly workflow * Trim down to supported Wagtail versions only * Add support for Python 3.13 * PR feedback
- Loading branch information
Showing
7 changed files
with
190 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
Called by GH Actions when the nightly build fails. | ||
This reports an error to the #nightly-build-failures Slack channel. | ||
""" | ||
|
||
import os | ||
|
||
import requests | ||
|
||
|
||
if "SLACK_WEBHOOK_URL" in os.environ: | ||
print("Reporting to #nightly-build-failures slack channel") | ||
response = requests.post( | ||
os.environ["SLACK_WEBHOOK_URL"], | ||
json={ | ||
"text": "A Nightly build failed. See https://github.com/torchbox/django-birdbath/actions/runs/" | ||
+ os.environ["GITHUB_RUN_ID"], | ||
}, | ||
timeout=30, | ||
) | ||
|
||
print("Slack responded with:", response) | ||
|
||
else: | ||
print( | ||
"Unable to report to #nightly-build-failures slack channel because SLACK_WEBHOOK_URL is not set" | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Nightly Wagtail Test | ||
|
||
on: | ||
schedule: | ||
- cron: '0 1 * * *' | ||
# At 01:00, daily | ||
workflow_dispatch: | ||
|
||
jobs: | ||
nightly-wagtail-test: | ||
runs-on: ubuntu-latest | ||
env: | ||
WEBHOOK_EXISTS: ${{ secrets.SLACK_WEBHOOK_URL != '' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- run: git clone https://github.com/wagtail/wagtail.git | ||
|
||
- run: python -m pip install flit | ||
- run: flit install --extras dev | ||
- run: python -m pip install ./wagtail | ||
|
||
- run: pytest | ||
|
||
- name: Report failure | ||
run: | | ||
python -m pip install requests | ||
python ./.github/scripts/report_nightly_build_failure.py | ||
if: ${{ failure() && env.WEBHOOK_EXISTS == 'true' }} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# See https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
# for a detailed guide | ||
name: Publish to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install flit | ||
python -m flit install --symlink | ||
- name: Build | ||
run: python -m flit build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./dist | ||
|
||
publish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: none | ||
id-token: write # required for trusted publishing | ||
environment: publish | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: artifact/ | ||
print-hash: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Django Birdbath CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'stable/**' | ||
|
||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- uses: pre-commit/action@v3.0.1 | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: lint | ||
strategy: | ||
matrix: | ||
python: ['3.9', '3.10', '3.11', '3.12', '3.13'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip tox tox-gh-actions | ||
- name: Test | ||
run: tox |
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
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
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