Skip to content

Commit

Permalink
Run CI tests using NodeJS instead of Python
Browse files Browse the repository at this point in the history
Python is failing to run in Github Actions, and we don't really care
about it - any static HTTP server will do.
  • Loading branch information
matiasgarciaisaia committed Aug 29, 2024
1 parent 1205b37 commit d5d622c
Show file tree
Hide file tree
Showing 3 changed files with 286 additions and 15 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,20 @@ jobs:
- name: Build the site
run: yarn export

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.5
- name: Install dev dependencies (for testing)
run: yarn install --non-interactive --no-progress

- name: Start web server
working-directory: ./out
run: |
python -m http.server &
yarn run http-server -o ./ &
sleep 5 &&
curl http://localhost:8000 -I
curl http://localhost:8080 -I
- name: Check for broken links
run: |
curl http://localhost:8000 -I &&
wget -r -l8000 --spider -e robots=off --reject-regex='\/&$' -D localhost http://localhost:8000 -o broken-links.log
curl http://localhost:8080 -I &&
wget -r -l8080 --spider -e robots=off --reject-regex='\/&$' -D localhost http://localhost:8080 -o broken-links.log
- name: Upload broken links log as artifact
uses: actions/upload-artifact@v4
if: failure()
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"remark-footnotes": "^3.0.0",
"remark-parse": "^9.0.0",
"remark-react": "^8.0.0"
},
"devDependencies": {
"http-server": "^14.1.1"
}
}
Loading

0 comments on commit d5d622c

Please sign in to comment.