![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 1 to 2.4.1. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v1...v2.4.1) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
name: Validate and process static files
|
|
|
|
on: [pull_request, push]
|
|
|
|
jobs:
|
|
static:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
VALIDATOR_VERSION: 20.6.30
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- uses: actions/setup-node@v2.4.1
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v1
|
|
env:
|
|
cache-name: cache-node-modules
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
- name: Cache validator
|
|
id: validator-cache
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: vnu-runtime-image
|
|
key: ${{ runner.os }}-validator-${{ env.VALIDATOR_VERSION }}
|
|
|
|
- run: sudo apt-get update
|
|
- run: sudo apt-get -y install libxml2-utils yajl-tools python3-lxml python3-cssselect moreutils brotli zopfli
|
|
- run: npm install
|
|
|
|
- name: Download validatornu
|
|
# There isn't a package with a `validatornu` command in Ubuntu, so download the validator
|
|
# from the GitHub releases and change the validate-static script later to use it.
|
|
run: wget https://github.com/validator/validator/releases/download/${{ env.VALIDATOR_VERSION }}/vnu.linux.zip && unzip vnu.linux.zip
|
|
if: steps.validator-cache.outputs.cache-hit != 'true'
|
|
|
|
- run: sed -i 's+validatornu+vnu-runtime-image/bin/vnu+g' validate-static
|
|
|
|
- name: validate static
|
|
run: ./validate-static
|
|
|
|
- name: process static
|
|
run: ./process-static
|