- Emblems for 81 trails, up from 41. Each is the trail's own crest, badge or roundel alone, cropped out of a larger logo where need be and made transparent where that could be done cleanly. Records without one say where an emblem was looked for. The validator checks the logo state. - Every record has a `[[history]]` list: what changed or was asked for, on what basis, who asked and whether it was applied or declined. `tools/check_history.py` fails a changed fact with no history entry and prints earlier entries about a changed field. It runs in CI before the site deploys. Each trail page shows the history. - A new page, "Considered and left out", built from `left-out.toml`: 35 trails and routes with the reason, the deciding fact and its source. - The Hoosier Heritage Trail has its ends, its free map set and its emblem from its association (issue 2). Any trail may list its holder's own guide or map set. - A stated permission is quoted in the download credit box. - `tools/gpx_track.py` turns a GPX file from a holder or a hiker into a record's track files. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
69 lines
2.3 KiB
YAML
69 lines
2.3 KiB
YAML
name: Validate
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
- run: python3 tools/validate.py
|
|
|
|
# A change to a fact needs a new [[history]] entry (docs/schema.md). The check compares the
|
|
# work with its base, so it needs the history of the base branch: a full clone, not the
|
|
# shallow one that checkout makes by default.
|
|
history:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
- name: Check the history
|
|
env:
|
|
EVENT: ${{ github.event_name }}
|
|
BASE_REF: ${{ github.base_ref }}
|
|
BEFORE: ${{ github.event.before }}
|
|
run: |
|
|
# A pull request is checked against its target branch; a push against the commit
|
|
# before it. A new branch has no such commit: the tool then uses origin/main.
|
|
if [ "$EVENT" = "pull_request" ]; then
|
|
base="origin/$BASE_REF"
|
|
else
|
|
base="$BEFORE"
|
|
fi
|
|
python3 tools/check_history.py --base "$base"
|
|
- run: python3 -m unittest discover tools/tests -p "test_history.py"
|
|
|
|
site:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
# Standard library only: no packages to install, and no ImageMagick.
|
|
# web/tools/make_thumbs.py is a manual tool; web/thumbs/ is committed
|
|
# and the build only copies those thumbnails (see web/olt/thumbs.py).
|
|
- run: python3 -m unittest discover -s web/tests
|
|
- run: python3 web/build.py --out _site
|
|
|
|
# Netlify builds the site from this repository when asked to. Asking only
|
|
# after both jobs above pass means a broken record or page is never deployed.
|
|
deploy:
|
|
needs: [validate, history, site]
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'swaits/longhikes'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Ask Netlify to build and publish main
|
|
env:
|
|
NETLIFY_BUILD_HOOK: ${{ secrets.NETLIFY_BUILD_HOOK }}
|
|
run: curl -fsS -X POST -d '{}' "$NETLIFY_BUILD_HOOK"
|