Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validator workflow #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
64 changes: 64 additions & 0 deletions .github/workflows/html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: "HTML"

on:
pull_request: null
push:
branches:
- "master"

permissions:
contents: "read"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
validator:
name: "Validator"
runs-on: "ubuntu-22.04"
timeout-minutes: 1
steps:
-
name: "Checkout repository"
uses: "actions/[email protected]"
-
name: "Setup Java"
uses: "actions/[email protected]"
with:
distribution: "temurin"
java-version: "21"
-
name: "Set up Node.js"
uses: "actions/[email protected]"
with:
node-version: "22"
check-latest: true
cache: "npm"
-
name: "Install The Nu Html Checker"
env:
GH_TOKEN: "${{ github.token }}"
run: |
set -o pipefail
mkdir -p "${{ runner.temp }}/validator"
RELEASE_ASSET_URL="$(
gh api /repos/validator/validator/releases/latest \
--jq '."assets"[] | select(."name" | test("^vnu\\.jar_.+\\.zip$")) | ."browser_download_url"'
)"
wget --secure-protocol=TLSv1_3 --max-redirect=1 --retry-on-host-error --retry-connrefused --tries=3 \
--quiet --output-document="${{ runner.temp }}/validator/vnu.zip" "${RELEASE_ASSET_URL}"
unzip -j -d "${{ runner.temp }}/validator" "${{ runner.temp }}/validator/vnu.zip" dist/vnu.jar
java -jar "${{ runner.temp }}/validator/vnu.jar" --version
-
name: "Install production dependencies"
run: "npm ci --omit=dev"
-
name: "Build website"
run: "npm run eleventy:build"
-
name: "Run validator on the frontpage"
run: |
java -jar "${{ runner.temp }}/validator/vnu.jar" dist/index.html