ci: build the site with the pinned motorino and check it on every pull request
This commit is contained in:
parent
bb926a4b2f
commit
4a1d04e079
1 changed files with 31 additions and 0 deletions
31
.forgejo/workflows/check.yml
Normal file
31
.forgejo/workflows/check.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
# Builds the site with the motorino pinned in .motorino-version and checks every page with the
|
||||||
|
# Nu HTML Checker, on every push to main and on every pull request, on the shared runner of git.kmalloc.org.
|
||||||
|
# The deploy is not here: the hook on the server publishes main.
|
||||||
|
name: check
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
- name: Install the pinned motorino
|
||||||
|
run: |
|
||||||
|
version=$(sed -n 1p .motorino-version)
|
||||||
|
hash=$(sed -n 2p .motorino-version)
|
||||||
|
curl -fsSL -o /usr/local/bin/motorino "https://git.kmalloc.org/squid/motorino/releases/download/v${version}/motorino-linux-amd64"
|
||||||
|
echo "${hash} /usr/local/bin/motorino" | sha256sum -c -
|
||||||
|
chmod 755 /usr/local/bin/motorino
|
||||||
|
- name: Build the site
|
||||||
|
run: motorino build -site . -out public
|
||||||
|
- name: Install the HTML checker
|
||||||
|
run: |
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install -y -qq --no-install-recommends default-jre-headless
|
||||||
|
npm install --no-save --no-audit --no-fund --prefix /tmp/vnu vnu-jar@26.11.14
|
||||||
|
- name: Check the HTML and the CSS
|
||||||
|
run: java -jar /tmp/vnu/node_modules/vnu-jar/build/dist/vnu.jar --also-check-css $(find public -name '*.html')
|
||||||
Loading…
Reference in a new issue