Fix sync recipes and add base justfile
Both the justfile and the pre-commit configuration for the `pr-check` sync were broken: * justfiles run recipes one line at a time in a fresh shell, so the venv activation was not working * the pre-commit config was relying on an installed `ruamel.yaml` pakcage, but the default one installable via `apt` on Ubuntu 24.04 is old and generates different output (with formatting differences). Now: * the venv dance is put in a separate bash script * both just and pre-commit will use that same script, so both problems will be fixed As a bonus, a root `justfile` is added exposing the `update-pr-checks` recipes plus a `build` one. Running `just` without arguments will also now call the default `sync` recipes that will call both of the above.
This commit is contained in:
parent
d99c7e8e5b
commit
d0aab9fc20
4 changed files with 18 additions and 7 deletions
|
|
@ -16,5 +16,5 @@ repos:
|
||||||
name: Synchronize PR check workflows
|
name: Synchronize PR check workflows
|
||||||
files: ^.github/workflows/__.*\.yml$|^pr-checks
|
files: ^.github/workflows/__.*\.yml$|^pr-checks
|
||||||
language: system
|
language: system
|
||||||
entry: python3 pr-checks/sync.py
|
entry: pr-checks/sync.sh
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|
|
||||||
7
justfile
Normal file
7
justfile
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
sync: build update-pr-checks
|
||||||
|
|
||||||
|
update-pr-checks:
|
||||||
|
pr-checks/sync.sh
|
||||||
|
|
||||||
|
build:
|
||||||
|
npm run build
|
||||||
|
|
@ -1,6 +1 @@
|
||||||
# Perform all necessary steps to update the PR checks
|
set fallback := true
|
||||||
update-pr-checks:
|
|
||||||
python3 -m venv env
|
|
||||||
source env/bin/activate
|
|
||||||
pip3 install ruamel.yaml
|
|
||||||
python3 sync.py
|
|
||||||
|
|
|
||||||
9
pr-checks/sync.sh
Executable file
9
pr-checks/sync.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
python3 -m venv env
|
||||||
|
source env/bin/activate
|
||||||
|
pip3 install ruamel.yaml
|
||||||
|
python3 sync.py
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue