Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 7, 2024
1 parent b7cb492 commit 913a01e
Show file tree
Hide file tree
Showing 24 changed files with 336 additions and 336 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/nigthly-tests.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
name: Nightly Wagtail test

on:
schedule:
# Nightly at 4am.
- cron: '0 4 * * *'
schedule:
# Nightly at 4am.
- cron: '0 4 * * *'

workflow_dispatch:
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
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
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 }}
- 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 }}
114 changes: 57 additions & 57 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
name: Publish to PyPI

on:
release:
types: [published]
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.12'
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
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.12'
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
30 changes: 15 additions & 15 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: Ruff

on:
push:
branches:
- main
- 'stable/**'
pull_request:
branches: [main]
push:
branches:
- main
- 'stable/**'
pull_request:
branches: [main]

jobs:
ruff:
runs-on: ubuntu-latest
ruff:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
steps:
- uses: actions/checkout@v4

# keep in sync with .pre-commit-config.yaml
- run: python -Im pip install --user ruff==0.6.4
# keep in sync with .pre-commit-config.yaml
- run: python -Im pip install --user ruff==0.6.4

- name: Run ruff
working-directory: .
run: ruff check --output-format=github wagtail_localize
- name: Run ruff
working-directory: .
run: ruff check --output-format=github wagtail_localize
Loading

0 comments on commit 913a01e

Please sign in to comment.