privacyguides.org/.github/workflows/tests.yml

378 lines
11 KiB
YAML
Raw Normal View History

2021-05-01 23:24:18 +02:00
name: Code tests
2021-05-02 05:59:01 +02:00
on:
push:
branches:
- main
pull_request:
branches:
- main
2021-05-01 23:24:18 +02:00
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
jobs:
deps:
name: "Dependency Install"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2021-05-02 05:59:01 +02:00
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2021-05-01 23:24:18 +02:00
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
- run: npm run assets:install
build:
name: "Jekyll Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2021-05-02 05:59:01 +02:00
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2021-05-01 23:24:18 +02:00
- uses: actions/setup-node@v2
with:
node-version: '14'
2021-05-02 05:59:01 +02:00
- name: Cache Jekyll build
uses: actions/cache@v2
with:
path: |
.jekyll-cache
.sass-cache
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/*.??m[ld]') }}
restore-keys: |
${{ runner.os }}-jekyll-
2021-05-01 23:24:18 +02:00
- name: Build website
uses: ./.github/actions/build
link:
2021-05-02 02:54:23 +02:00
name: "Broken Hyperlinks (Internal)"
2021-05-01 23:24:18 +02:00
runs-on: ubuntu-latest
needs: [deps, build]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2021-05-02 05:59:01 +02:00
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2021-05-01 23:24:18 +02:00
- uses: actions/setup-node@v2
with:
node-version: '14'
2021-05-02 05:59:01 +02:00
- name: Cache Jekyll build
uses: actions/cache@v2
with:
path: |
.jekyll-cache
.sass-cache
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/*.??m[ld]') }}
restore-keys: |
${{ runner.os }}-jekyll-
2021-05-01 23:24:18 +02:00
- name: Build website
uses: ./.github/actions/build
- name: Copy built site to production
run: |
mv ${{ github.workspace }}/_site /tmp/
mkdir -p /tmp/src
mv ${{ github.workspace }}/* /tmp/src/
mkdir -p ${{ github.workspace }}/src
mv /tmp/src/* ${{ github.workspace }}/src/
mv /tmp/_site ${{ github.workspace }}/
2021-05-02 05:59:01 +02:00
- name: Internal link checker
2021-05-01 23:24:18 +02:00
uses: untitaker/hyperlink@0.1.15
with:
args: _site/ --sources src/
2021-05-02 02:54:23 +02:00
extlink:
name: "Broken Hyperlinks (External)"
runs-on: ubuntu-latest
needs: [build, link]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2021-05-02 05:59:01 +02:00
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2021-05-02 02:54:23 +02:00
- uses: actions/setup-node@v2
with:
node-version: '14'
2021-05-02 05:59:01 +02:00
- name: Cache Jekyll build
uses: actions/cache@v2
with:
path: |
.jekyll-cache
.sass-cache
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/*.??m[ld]') }}
restore-keys: |
${{ runner.os }}-jekyll-
2021-05-02 02:54:23 +02:00
- name: Build website
uses: ./.github/actions/build
2021-05-02 05:59:01 +02:00
- name: Cache HTMLProofer
id: cache-htmlproofer
uses: actions/cache@v2
with:
path: tmp/.htmlproofer
key: ${{ runner.os }}-htmlproofer-${{ hashFiles('_site/**.html') }}
restore-keys: |
${{ runner.os }}-htmlproofer-
${{ runner.os }}-htmlproofer
- name: Check All External Links (Informational)
2021-05-02 05:18:10 +02:00
uses: chabad360/htmlproofer@v1.1
with:
directory: ${{ github.workspace }}/_site
2021-05-02 05:59:01 +02:00
arguments: --assume-extension --external_only --internal-domains privacyguides.org,www.privacyguides.org --timeframe 30d
2021-05-02 05:18:10 +02:00
continue-on-error: true
2021-05-02 05:59:01 +02:00
- name: Check External Links (Only 4XX)
2021-05-02 02:54:23 +02:00
uses: chabad360/htmlproofer@v1.1
with:
directory: ${{ github.workspace }}/_site
2021-05-02 05:59:01 +02:00
arguments: --assume-extension --external_only --only_4xx --http-status-ignore 429 --internal-domains privacyguides.org,www.privacyguides.org --timeframe 30d
2021-05-02 02:54:23 +02:00
https:
2021-05-02 03:46:06 +02:00
name: "Require HTTPS Internal Images"
2021-05-02 02:54:23 +02:00
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2021-05-02 05:59:01 +02:00
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2021-05-02 02:54:23 +02:00
- uses: actions/setup-node@v2
with:
node-version: '14'
2021-05-02 05:59:01 +02:00
- name: Cache Jekyll build
uses: actions/cache@v2
with:
path: |
.jekyll-cache
.sass-cache
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/*.??m[ld]') }}
restore-keys: |
${{ runner.os }}-jekyll-
2021-05-02 02:54:23 +02:00
- name: Build website
uses: ./.github/actions/build
2021-05-02 05:59:01 +02:00
- name: Check Images
2021-05-02 02:54:23 +02:00
uses: chabad360/htmlproofer@v1.1
with:
directory: ${{ github.workspace }}/_site
2021-05-02 03:46:06 +02:00
arguments: --assume-extension --check-img-http --internal-domains privacyguides.org,www.privacyguides.org --disable-external --checks-to-ignore LinkCheck,ScriptCheck
2021-05-02 02:54:23 +02:00
scripts:
name: "Script Reference Checks"
runs-on: ubuntu-latest
needs: [build, link]
2021-05-02 02:54:23 +02:00
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v2
with:
node-version: '14'
2021-05-02 05:59:01 +02:00
- name: Cache Jekyll build
uses: actions/cache@v2
with:
path: |
.jekyll-cache
.sass-cache
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/*.??m[ld]') }}
restore-keys: |
${{ runner.os }}-jekyll-
2021-05-02 02:54:23 +02:00
- name: Build website
uses: ./.github/actions/build
- name: Check HTML
uses: chabad360/htmlproofer@v1.1
with:
directory: ${{ github.workspace }}/_site
2021-05-02 03:46:06 +02:00
arguments: --assume-extension --check-html --disable-external --check-sri --report-script-embeds --internal-domains privacyguides.org,www.privacyguides.org --checks-to-ignore LinkCheck,ImageCheck,HtmlCheck
2021-05-02 02:54:23 +02:00
tags:
name: "HTML Tag Test"
runs-on: ubuntu-latest
needs: build
2021-05-02 02:54:23 +02:00
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2021-05-02 05:59:01 +02:00
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2021-05-02 02:54:23 +02:00
- uses: actions/setup-node@v2
with:
node-version: '14'
2021-05-02 05:59:01 +02:00
- name: Cache Jekyll build
uses: actions/cache@v2
with:
path: |
.jekyll-cache
.sass-cache
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/*.??m[ld]') }}
restore-keys: |
${{ runner.os }}-jekyll-
2021-05-02 02:54:23 +02:00
- name: Build website
uses: ./.github/actions/build
- name: Check HTML
uses: chabad360/htmlproofer@v1.1
with:
directory: ${{ github.workspace }}/_site
2021-05-02 03:46:06 +02:00
arguments: --assume-extension --check-html --disable-external --allow-hash-href --internal-domains privacyguides.org,www.privacyguides.org --report-invalid-tags --report-eof-tags --report-mismatched-tags --checks-to-ignore LinkCheck,ImageCheck,ScriptCheck
2021-05-02 02:54:23 +02:00
entity:
name: "HTML Entity Names Test"
runs-on: ubuntu-latest
needs: build
2021-05-02 02:54:23 +02:00
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2021-05-02 05:59:01 +02:00
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2021-05-02 02:54:23 +02:00
- uses: actions/setup-node@v2
with:
node-version: '14'
2021-05-02 05:59:01 +02:00
- name: Cache Jekyll build
uses: actions/cache@v2
with:
path: |
.jekyll-cache
.sass-cache
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/*.??m[ld]') }}
restore-keys: |
${{ runner.os }}-jekyll-
2021-05-02 02:54:23 +02:00
- name: Build website
uses: ./.github/actions/build
- name: Check HTML
uses: chabad360/htmlproofer@v1.1
with:
directory: ${{ github.workspace }}/_site
2021-05-02 03:46:06 +02:00
arguments: --assume-extension --check-html --disable-external --allow-hash-href --internal-domains privacyguides.org,www.privacyguides.org --report-missing-names --checks-to-ignore LinkCheck,ImageCheck,ScriptCheck
2021-05-02 02:54:23 +02:00
misc:
name: "Misc HTML Test"
runs-on: ubuntu-latest
needs: build
2021-05-02 02:54:23 +02:00
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2021-05-02 05:59:01 +02:00
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2021-05-02 02:54:23 +02:00
- uses: actions/setup-node@v2
with:
node-version: '14'
2021-05-02 05:59:01 +02:00
- name: Cache Jekyll build
uses: actions/cache@v2
with:
path: |
.jekyll-cache
.sass-cache
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/*.??m[ld]') }}
restore-keys: |
${{ runner.os }}-jekyll-
2021-05-02 02:54:23 +02:00
- name: Build website
uses: ./.github/actions/build
- name: Check HTML
uses: chabad360/htmlproofer@v1.1
with:
directory: ${{ github.workspace }}/_site
2021-05-02 03:46:06 +02:00
arguments: --assume-extension --check-html --disable-external --internal-domains privacyguides.org,www.privacyguides.org --report-missing-doctype --checks-to-ignore LinkCheck,ImageCheck,ScriptCheck
2021-05-02 02:54:23 +02:00
opengraph:
name: "OpenGraph Test"
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2021-05-02 05:59:01 +02:00
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2021-05-02 02:54:23 +02:00
- uses: actions/setup-node@v2
with:
node-version: '14'
2021-05-02 05:59:01 +02:00
- name: Cache Jekyll build
uses: actions/cache@v2
with:
path: |
.jekyll-cache
.sass-cache
key: ${{ runner.os }}-jekyll-${{ hashFiles('**/*.??m[ld]') }}
restore-keys: |
${{ runner.os }}-jekyll-
2021-05-02 02:54:23 +02:00
- name: Build website
uses: ./.github/actions/build
- name: Check HTML
uses: chabad360/htmlproofer@v1.1
with:
directory: ${{ github.workspace }}/_site
2021-05-02 03:46:06 +02:00
arguments: --assume-extension --disable-external --check-opengraph --checks-to-ignore LinkCheck,ImageCheck,ScriptCheck