Skip to content

Commit e9a5ca6

Browse files
committed
CI: check for broken links on website
Ensure all internal links on our website are working. External links are not checked to avoid flakiness.
1 parent 2807115 commit e9a5ca6

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ RUN \
6262
ninja-build \
6363
nodejs \
6464
python3.7 \
65+
python3.7-venv \
6566
sudo \
6667
tar \
6768
unzip \

.github/workflows/build-website.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
build:
1212
name: website
1313
runs-on: ubuntu-latest
14-
container: ghcr.io/quick-lint/quick-lint-js-github-builder:v1
14+
container: ghcr.io/quick-lint/quick-lint-js-github-builder:v3
1515
env:
1616
QLJS_COLLECT_COPYRIGHT_NO_WARNINGS: 1
1717
steps:
@@ -40,6 +40,29 @@ jobs:
4040
- name: bundle site
4141
run: cd website && zip -r ../website.zip www
4242

43+
- name: set up check-links
44+
run: |
45+
python3.7 -m venv ENV
46+
ENV/bin/pip install bs4 requests
47+
- name: check links (dev)
48+
run: |
49+
cd website/
50+
yarn start localhost 9001 &
51+
sleep 0.5 # HACK(strager): Wait for server to start.
52+
cd ../
53+
./ENV/bin/python ./tools/check-links http://localhost:9001/
54+
kill %1
55+
shell: bash
56+
- name: check links (build)
57+
run: |
58+
cd website/www/
59+
python3.7 -m http.server 9002 &
60+
sleep 0.5 # HACK(strager): Wait for server to start.
61+
cd ../../
62+
./ENV/bin/python ./tools/check-links http://localhost:9002/
63+
kill %1
64+
shell: bash
65+
4366
- name: upload build to workflow
4467
uses: actions/upload-artifact@v2
4568
with:

0 commit comments

Comments
 (0)