Skip to content

Commit

Permalink
Merge pull request #10 from szepeviktor/szepeviktor-patch-1
Browse files Browse the repository at this point in the history
Add validator workflow
  • Loading branch information
adamlaki authored Dec 31, 2024
2 parents b2c9f64 + da5718c commit 38b992e
Showing 1 changed file with 64 additions and 0 deletions.
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

0 comments on commit 38b992e

Please sign in to comment.