diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4948cc4 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index de4a137..0000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - 10 - - stable -script: - npm run lint