Run EPUBCheck on CI

This should help detect any issues such as those seen in #22.
This commit is contained in:
Domenic Denicola 2021-01-01 17:48:41 -05:00 committed by GitHub
commit 48400e6f96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 6 deletions

50
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,50 @@
name: Test
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test:
name: Test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm install
- run: npm run lint
# CI would take too long if we did the download every time too. So, we cache it. This does mean we're vulnerable to
# source changes exposing problems in our code, but those are pretty infrequent. If they occur, we need to bump the
# cache key.
- uses: actions/cache@v2
with:
key: worm-ward-cache-2020-12-31
path: ./cache
- run: node ./lib/worm-scraper.js --book=worm
- run: node ./lib/worm-scraper.js --book=ward
- uses: actions/setup-java@v1
with:
java-version: 15
java-package: jre
- name: Get EPUBCheck
run: |
curl https://github.com/w3c/epubcheck/releases/download/v4.2.4/epubcheck-4.2.4.zip --location --output epubcheck.zip
unzip epubcheck.zip
- name: Check Worm.epub
run: java -jar epubcheck-4.2.4/epubcheck.jar --failonwarnings Worm.epub
- name: Check Ward.epub
run: java -jar epubcheck-4.2.4/epubcheck.jar --failonwarnings Ward.epub

View file

@ -1,6 +0,0 @@
language: node_js
node_js:
- 10
- stable
script:
npm run lint