-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update ruff version and use for formatting as well * Lint * Remove unused runtime.txt * Move nightly tests to GHA * Tidy up tox config * Ensure we're using coverage >= 7.0 * Add a publish action includes asset build * Tidy up ignore files * Drop the lint step in favour of pre-commit.ci * Tidy up README * Regenerate test migrations as an initial one (speeds up things)
- Loading branch information
Showing
36 changed files
with
723 additions
and
2,138 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
This reports an error to the #nightly-build-failures Slack channel. | ||
""" | ||
|
||
import os | ||
|
||
import requests | ||
|
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,36 @@ | ||
name: Nightly Wagtail test | ||
|
||
on: | ||
schedule: | ||
# Nightly at 4am. | ||
- cron: '0 4 * * *' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
nightly-test: | ||
# Cannot check the existence of secrets, so limiting to repository name to prevent all forks to run nightly. | ||
# See: https://github.com/actions/runner/issues/520 | ||
if: ${{ github.repository == 'wagtail/wagtail-localize' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip tox | ||
- name: Test | ||
id: test | ||
continue-on-error: true | ||
run: tox -e wagtailmain | ||
|
||
- name: Send Slack notification on failure | ||
if: steps.test.outcome == 'failure' | ||
run: | | ||
python .github/scripts/report_nightly_build_failure.py | ||
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,62 @@ | ||
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 Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Install Node dependencies | ||
run: npm ci | ||
|
||
- name: Build static files | ||
run: ./node_modules/.bin/webpack --mode production | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: '**/pyproject.toml' | ||
|
||
- name: ⬇️ Install build dependencies | ||
run: | | ||
python -m pip install -U flit | ||
- name: 🏗️ Build | ||
run: python -m flit build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./dist | ||
|
||
# https://docs.pypi.org/trusted-publishers/using-a-publisher/ | ||
pypi-publish: | ||
needs: build | ||
environment: 'publish' | ||
|
||
name: ⬆️ Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# Mandatory for trusted publishing | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
|
||
- name: 🚀 Publish package distributions 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,22 @@ | ||
name: Ruff | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'stable/**' | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: python -Im pip install --user ruff | ||
|
||
- name: Run ruff | ||
working-directory: . | ||
run: ruff --output-format=github wagtail_localize |
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
Oops, something went wrong.