summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinthewaves <26474149+inthewaves@users.noreply.github.com>2020-05-03 22:09:12 -0700
committerDaniel Micay <danielmicay@gmail.com>2020-05-06 15:09:55 -0400
commit9d68744f202b142ff74db523bc116e58cffd4691 (patch)
tree30d9a919f47905634c8050ddbc2777ebd6cf8bdf
parent4f41c03436d3c036170d33557949741675f3e9f9 (diff)
add GitHub workflow for validate_static
Uses a GitHub-hosted runner in order to run validate_static for all pull requests and pushes to master. See https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions for more details.
-rw-r--r--.github/workflows/validate-static.yml47
1 files changed, 47 insertions, 0 deletions
diff --git a/.github/workflows/validate-static.yml b/.github/workflows/validate-static.yml
new file mode 100644
index 00000000..f6083e7d
--- /dev/null
+++ b/.github/workflows/validate-static.yml
@@ -0,0 +1,47 @@
+name: Validate static
+
+on:
+ pull_request:
+ push:
+ branches: [master]
+
+jobs:
+ validate-static:
+ runs-on: ubuntu-latest
+
+ env:
+ VALIDATOR_VERSION: 20.3.16
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v1
+
+ - 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 -y install libxml2-utils
+ - 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
+