Skip to content

Commit 2984dfe

Browse files
committed
chore(ci): unify quality checks and active-page validation
1 parent b1f7e06 commit 2984dfe

8 files changed

Lines changed: 154 additions & 20 deletions

File tree

‎.github/workflows/pages.yml‎

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,33 @@ jobs:
2626
node-version: 20
2727
cache: npm
2828

29-
- name: Install Node dependencies
30-
run: npm ci
31-
32-
- name: Build Tailwind CSS
33-
run: npm run build:css
34-
3529
- name: Setup Ruby
3630
uses: ruby/setup-ruby@v1
3731
with:
3832
ruby-version: '3.1'
3933
bundler-cache: true
4034

41-
- name: Build Jekyll site
42-
run: bundle exec jekyll build --destination ./_site
35+
- name: Install Node dependencies
36+
run: npm ci
37+
38+
- name: Check executable bits
39+
run: npm run check:mode
40+
41+
- name: Build site
42+
run: npm run build
43+
44+
- name: Verify generated CSS
45+
run: npm run check:css
4346

4447
- name: Validate generated HTML
4548
run: npm run check:html
4649

50+
- name: Collect active HTML pages
51+
id: active_pages
52+
run: |
53+
pages="$(./scripts/list-active-html.sh _site | tr '\n' ' ')"
54+
echo "pages=$pages" >> "$GITHUB_OUTPUT"
55+
4756
- name: Accessibility smoke check (Lighthouse)
4857
uses: treosh/lighthouse-ci-action@v12
4958
with:
@@ -55,10 +64,7 @@ jobs:
5564
with:
5665
args: >-
5766
--verbose --no-progress --offline --exclude-mail
58-
./_site/index.html ./_site/download.html ./_site/documentation.html
59-
./_site/community.html ./_site/news.html ./_site/publications.html
60-
./_site/interfaces.html ./_site/projects.html ./_site/flatzinc.html
61-
./_site/license.html ./_site/disclaimer.html ./_site/logo.html
67+
${{ steps.active_pages.outputs.pages }}
6268
env:
6369
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6470

@@ -68,10 +74,7 @@ jobs:
6874
with:
6975
args: >-
7076
--verbose --no-progress --exclude-mail
71-
./_site/index.html ./_site/download.html ./_site/documentation.html
72-
./_site/community.html ./_site/news.html ./_site/publications.html
73-
./_site/interfaces.html ./_site/projects.html ./_site/flatzinc.html
74-
./_site/license.html ./_site/disclaimer.html ./_site/logo.html
77+
${{ steps.active_pages.outputs.pages }}
7578
env:
7679
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7780

‎.htmlvalidate.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"attr-quotes": "off",
55
"deprecated": "off",
66
"element-permitted-content": "off",
7-
"no-deprecated-attr": "off",
8-
"no-inline-style": "off",
7+
"no-deprecated-attr": "error",
8+
"no-inline-style": "error",
99
"no-trailing-whitespace": "off",
1010
"prefer-tbody": "off",
1111
"void-style": "off",

‎README.md‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Gecode Website (Jekyll + GitHub Pages)
2+
3+
This repository hosts the Gecode website and is built with Jekyll and Tailwind CSS.
4+
5+
## Requirements
6+
7+
- Ruby `3.1.6` (or compatible `>= 3.1`)
8+
- Bundler (for the selected Ruby version)
9+
- Node.js `20.x`
10+
- npm
11+
12+
## Quick Start
13+
14+
1. Install Node dependencies:
15+
16+
```bash
17+
npm ci
18+
```
19+
20+
2. Start local development (Tailwind watch + Jekyll serve):
21+
22+
```bash
23+
npm run dev
24+
```
25+
26+
3. Build the site:
27+
28+
```bash
29+
npm run build
30+
```
31+
32+
## Quality Checks
33+
34+
Run the full CI-equivalent checks locally:
35+
36+
```bash
37+
npm run check:quality
38+
```
39+
40+
This command:
41+
42+
- rebuilds CSS and site output
43+
- verifies generated CSS is in sync with source
44+
- checks executable-bit hygiene
45+
- validates generated active-site HTML pages
46+
47+
## Notes on Scope
48+
49+
- `doc/` and `users-archive/` are treated as frozen historical archives.
50+
- Active-page checks intentionally exclude those frozen archives.

‎package.json‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
"build:setup": "./scripts/setup-jekyll.sh",
77
"build:site": "BUNDLE_PATH=vendor/bundle bundle exec jekyll build --destination ./_site",
88
"build": "npm run build:css && npm run build:setup && npm run build:site",
9-
"check:html": "html-validate _site/index.html _site/download.html _site/documentation.html _site/community.html _site/news.html _site/publications.html _site/interfaces.html _site/projects.html _site/flatzinc.html _site/license.html _site/disclaimer.html _site/logo.html",
10-
"check:quality": "npm run check:html",
9+
"check:html": "./scripts/check-html.sh",
10+
"check:css": "./scripts/check-generated-css.sh",
11+
"check:mode": "./scripts/check-executable-bits.sh",
12+
"check:quality": "npm run build && npm run check:css && npm run check:mode && npm run check:html",
1113
"watch:css": "npx @tailwindcss/cli -i ./assets/css/tailwind.css -o ./assets/css/site.css --watch",
1214
"serve:jekyll": "BUNDLE_PATH=vendor/bundle bundle exec jekyll serve --livereload --incremental",
1315
"dev:setup": "./scripts/setup-jekyll.sh",

‎scripts/check-executable-bits.sh‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
bad_files=()
5+
while IFS= read -r path; do
6+
if [ -f "$path" ] && [ -x "$path" ]; then
7+
bad_files+=("$path")
8+
fi
9+
done < <(git ls-files | grep -Ev '^(doc/|users-archive/|scripts/)' || true)
10+
11+
if [ "${#bad_files[@]}" -gt 0 ]; then
12+
echo "Unexpected executable bits set on tracked files:" >&2
13+
printf ' %s\n' "${bad_files[@]}" >&2
14+
echo "Only scripts under scripts/ (and frozen archives under doc/ and users-archive/) may be executable." >&2
15+
exit 1
16+
fi
17+
18+
echo "Executable bits check passed."

‎scripts/check-generated-css.sh‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
if [ ! -f assets/css/site.css ]; then
5+
echo "Missing generated CSS file: assets/css/site.css" >&2
6+
echo "Run: npm run build:css" >&2
7+
exit 1
8+
fi
9+
10+
checksum() {
11+
if command -v sha256sum >/dev/null 2>&1; then
12+
sha256sum "$1" | awk '{print $1}'
13+
else
14+
shasum -a 256 "$1" | awk '{print $1}'
15+
fi
16+
}
17+
18+
before_checksum="$(checksum assets/css/site.css)"
19+
20+
npm run --silent build:css
21+
22+
after_checksum="$(checksum assets/css/site.css)"
23+
24+
if [ "$before_checksum" != "$after_checksum" ]; then
25+
echo "Generated CSS was out of date and has been regenerated: assets/css/site.css" >&2
26+
echo "Run: npm run build:css" >&2
27+
exit 1
28+
fi
29+
30+
echo "Generated CSS matches source."

‎scripts/check-html.sh‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
site_dir="${1:-_site}"
5+
6+
pages=()
7+
while IFS= read -r page; do
8+
pages+=("$page")
9+
done < <("$(dirname "$0")/list-active-html.sh" "$site_dir")
10+
11+
if [ "${#pages[@]}" -eq 0 ]; then
12+
echo "No active HTML pages found under $site_dir" >&2
13+
exit 1
14+
fi
15+
16+
npx html-validate "${pages[@]}"

‎scripts/list-active-html.sh‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
site_dir="${1:-_site}"
5+
6+
if [ ! -d "$site_dir" ]; then
7+
echo "Site directory not found: $site_dir" >&2
8+
exit 1
9+
fi
10+
11+
find "$site_dir" -type f -name '*.html' \
12+
! -path "$site_dir/doc/*" \
13+
! -path "$site_dir/doc-latest/*" \
14+
! -path "$site_dir/users-archive/*" \
15+
| LC_ALL=C sort

0 commit comments

Comments
 (0)