From 4a1d04e0791d3dca63739b991cca32e042a12109 Mon Sep 17 00:00:00 2001 From: squid Date: Sun, 15 Nov 2026 10:23:31 +0100 Subject: [PATCH] ci: build the site with the pinned motorino and check it on every pull request --- .forgejo/workflows/check.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .forgejo/workflows/check.yml diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml new file mode 100644 index 0000000..770488e --- /dev/null +++ b/.forgejo/workflows/check.yml @@ -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')