Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
- uses: j178/prek-action@v1
- uses: j178/prek-action@0bb87d7f00b0c99306c8bcb8b8beba1eb581c037 # v1.1.1
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand All @@ -34,7 +34,7 @@ jobs:
requirements.txt

- name: Set up node
uses: actions/setup-node@v7
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 16
cache: 'npm'
Expand All @@ -44,7 +44,7 @@ jobs:
run: |
python -m pip install -U pip
python -m pip install -Ur requirements.txt --prefer-binary
npm install svgexport
npm install

- name: Unit tests
run: |
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Update site

on:
schedule:
# Daily, 04:07 UTC
- cron: "7 4 * * *"
workflow_dispatch:
inputs:
push:
description: "Deploy to gh-pages (untick for a dry run)"
type: boolean
default: true

env:
FORCE_COLOR: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1

permissions: {}

concurrency:
group: update-site
cancel-in-progress: false

jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write # to push the build to gh-pages
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: true

- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
cache: pip
cache-dependency-path: requirements.txt

- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 16

- name: Install dependencies
run: |
python -m pip install -r requirements.txt
npm install

- name: Build
run: ./build.sh

- name: Deploy to gh-pages
if: github.event_name == 'schedule' || inputs.push
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
rev=$(git rev-parse HEAD)
git fetch --depth=1 origin gh-pages
git worktree add --detach "$RUNNER_TEMP/gh-pages" origin/gh-pages
cd "$RUNNER_TEMP/gh-pages"
git rm -rfq .
git checkout origin/gh-pages -- .gitignore
cp -R "$GITHUB_WORKSPACE"/build/* .
git add .
git commit -m "Deploy $rev"
git push origin HEAD:gh-pages
13 changes: 9 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.20
rev: v0.16.10
hooks:
- id: ruff-check
args: [--exit-non-zero-on-fix]
Expand All @@ -26,7 +26,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.4
rev: "0.38.2"
hooks:
- id: check-github-workflows

Expand All @@ -35,13 +35,18 @@ repos:
hooks:
- id: actionlint

- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.30.1
hooks:
- id: zizmor

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.25.1
rev: v2.29.4
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.25
rev: "0.26"
hooks:
- id: validate-pyproject
- repo: meta
Expand Down
Loading