Update GitHub Actions workflows (#3270)
This commit is contained in:
parent
ce3a33067d
commit
2c5152bb40
|
@ -1,12 +1,18 @@
|
|||
name: Read the Docs PR preview
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
documentation-links:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
name: Lint
|
||||
name: Lint PEPs
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
|
@ -8,13 +21,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python 3
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: "3.x"
|
||||
cache: pip
|
||||
|
||||
- name: Run pre-commit hooks
|
||||
uses: pre-commit/action@v3.0.0
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
name: Render PEPs
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
|
||||
jobs:
|
||||
render-peps:
|
||||
|
@ -9,40 +22,42 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.x", "3.12-dev"]
|
||||
python-version:
|
||||
- "3.x"
|
||||
- "3.12-dev"
|
||||
|
||||
steps:
|
||||
- name: 🛎️ Checkout
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # fetch all history so that last modified date-times are accurate
|
||||
|
||||
- name: 🐍 Set up Python ${{ matrix.python-version }}
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: pip
|
||||
|
||||
- name: 👷 Install dependencies
|
||||
- name: Update pip
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
|
||||
- name: 🔧 Render PEPs
|
||||
- name: Render PEPs
|
||||
run: make dirhtml JOBS=$(nproc)
|
||||
|
||||
# remove the .doctrees folder when building for deployment as it takes two thirds of disk space
|
||||
- name: 🔥 Clean up files
|
||||
- name: Clean up files
|
||||
run: rm -r build/.doctrees/
|
||||
|
||||
- name: 🚀 Deploy to GitHub pages
|
||||
- name: Deploy to GitHub pages
|
||||
# This allows CI to build branches for testing
|
||||
if: (github.ref == 'refs/heads/main') && (matrix.python-version == '3.x')
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
folder: build # Synchronise with build.py -> build_directory
|
||||
folder: build # Synchronise with Makefile -> OUTPUT_DIR
|
||||
single-commit: true # Delete existing files
|
||||
|
||||
- name: ♻️ Purge CDN cache
|
||||
- name: Purge CDN cache
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
curl -H "Accept: application/json" -H "Fastly-Key: $FASTLY_TOKEN" -X POST "https://api.fastly.com/service/$FASTLY_SERVICE_ID/purge_all"
|
||||
|
|
|
@ -13,6 +13,13 @@ on:
|
|||
- "tox.ini"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
|
||||
|
@ -22,12 +29,18 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.9", "3.10", "3.11", "3.12-dev"]
|
||||
os: [windows-latest, macos-latest, ubuntu-latest]
|
||||
python-version:
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
- "3.12-dev"
|
||||
os:
|
||||
- "windows-latest"
|
||||
- "macos-latest"
|
||||
- "ubuntu-latest"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
|
@ -40,7 +53,7 @@ jobs:
|
|||
python -m pip install -U wheel
|
||||
python -m pip install -U tox
|
||||
|
||||
- name: Run tests with tox
|
||||
- name: Run tests
|
||||
run: |
|
||||
tox -e py -- -v --cov-report term
|
||||
|
||||
|
|
1
Makefile
1
Makefile
|
@ -7,6 +7,7 @@ SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
|
|||
BUILDER = html
|
||||
JOBS = 8
|
||||
SOURCES =
|
||||
# synchronise with render.yml -> deploy step
|
||||
OUTPUT_DIR = build
|
||||
SPHINXERRORHANDLING =
|
||||
|
||||
|
|
Loading…
Reference in New Issue