-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add HTML validator action (#1) * Add HTML validator action * Update root to `_site` * Update validate.yml * Update validate.yml * Update validate.yml * Add check-links * Update validate.yml * Add lighthouse and ignores for URLs * Add lighthouse config * Update validate.yml * Hash-pin `html5validator-action` * Try with nox * Set all thresholds to 0.95, correct noxfile * Update names as suggested in review * Add back the checkout step * Revert to building in jekyll container for speed Docker approach is way faster (1 minute vs 6.5 minutes) * Maybe we don't need to copy assets? * Fix some links, ignore netlify-preview from README.md * Fix link check, simplify naming * Add documentation, use absolute links in index * Fix wrong extension for img fallback * Two more places where absolute links needed * Fix jpg -> png in two more places
- Loading branch information
1 parent
b868aeb
commit 485005d
Showing
7 changed files
with
163 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"ci": { | ||
"collect": { | ||
"staticDistDir": "./_site", | ||
"autodiscoverUrlBlocklist": [ | ||
"conduct.html" | ||
], | ||
"settings": { | ||
"skipAudits": ["canonical"] | ||
} | ||
}, | ||
"assert": { | ||
"assertions": { | ||
"categories:performance": ["error", { "minScore": 0.95 }], | ||
"categories:accessibility": ["error", { "minScore": 0.95 }], | ||
"categories:best-practices": ["error", { "minScore": 0.95 }], | ||
"categories:seo": ["error", { "minScore": 0.95 }] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build Jekyll site for testing | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build the site in the Jekyll/builder container | ||
run: | | ||
docker run \ | ||
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ | ||
jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" | ||
- name: List result of Jekyll build | ||
run: | | ||
ls _site/ -l | ||
ls _site/assets -l | ||
# - name: Copy assets | ||
# run: cp -r assets _site/assets | ||
|
||
- name: Publish built site | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Built site ${{ github.run_number }} | ||
path: ./_site | ||
if-no-files-found: error | ||
|
||
validate: | ||
|
||
runs-on: ubuntu-latest | ||
name: Validate HTML | ||
needs: [build] | ||
|
||
steps: | ||
- name: Fetch built site | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: Built site ${{ github.run_number }} | ||
path: ./_site | ||
|
||
# just to satisfy the `Cyb3r-Jak3/html5validator-action` action | ||
- name: Create dummy git repository | ||
run: git init | ||
|
||
- name: HTML5 Validator | ||
uses: Cyb3r-Jak3/html5validator-action@44696509d19bec6bd00e5ebf29bbeda320562aac | ||
with: | ||
root: _site/ | ||
|
||
check-links: | ||
|
||
runs-on: ubuntu-latest | ||
name: Check links | ||
needs: [build] | ||
|
||
steps: | ||
- name: Fetch built site | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: Built site ${{ github.run_number }} | ||
path: ./_site | ||
|
||
- name: Install link check dependencies | ||
run: pip install pytest-check-links | ||
|
||
# TODO: we are not checking absolute links as pytest plugins does not support them | ||
- name: Check links | ||
run: | | ||
pytest _site/ --check-links \ | ||
--check-links-ignore "https://.*linkedin.com/.*" \ | ||
--check-links-ignore "/" \ | ||
--check-links-ignore ".github/images/netlify-preview.png" | ||
lighthouse: | ||
|
||
runs-on: ubuntu-latest | ||
name: Audit with Lighthouse | ||
needs: [build] | ||
|
||
steps: | ||
- name: Fetch repository for `lighthouserc.json` | ||
uses: actions/checkout@v2 | ||
- name: Fetch built site | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: Built site ${{ github.run_number }} | ||
path: ./_site | ||
- name: Audit with Lighthouse | ||
uses: treosh/lighthouse-ci-action@v8 | ||
with: | ||
configPath: ".github/workflows/lighthouserc.json" | ||
temporaryPublicStorage: true | ||
uploadArtifacts: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters