Skip to content

Add use_asyncglk option to test AsyncGlk's GlkApi #227

Add use_asyncglk option to test AsyncGlk's GlkApi

Add use_asyncglk option to test AsyncGlk's GlkApi #227

name: test-and-deploy
on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
jobs:
build-emglken:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Get Emglken commit ref
id: emglken-ref
run: echo "ref=$(git submodule status src/upstream/emglken | cut -c 2-13)" >> $GITHUB_OUTPUT
- name: Cache the built Emglken
id: cache-emglken
uses: actions/cache@v3
with:
path: |
src/upstream/emglken/build/*.js
src/upstream/emglken/build/*.wasm
key: emglken-${{ steps.emglken-ref.outputs.ref }}
- name: Build Emglken
if: steps.cache-emglken.outputs.cache-hit != 'true'
run: ./src/upstream/emglken/src/build.sh
outputs:
ref: ${{ steps.emglken-ref.outputs.ref }}
test-and-deploy:
needs: build-emglken
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: |
npm install --ignore-scripts
# Manually run Puppeteer's post install script
node ./node_modules/puppeteer/install.js
npm run link-local-emglken
- name: Static tests
run: |
npm run lint
npm run tsc-check
- name: Restore Emglken from the cache
id: cache-emglken
uses: actions/cache@v3
with:
path: |
src/upstream/emglken/build/*.js
src/upstream/emglken/build/*.wasm
key: emglken-${{ needs.build-emglken.outputs.ref }}
- name: Build Parchment distributions
run: |
./build.js
./tools/make-single-file.js
./tools/package-inform7.sh
- name: Test storyfiles
run: ./tests/runtests.sh
- name: Check browser compatibility
run: ./tests/check-compat.sh
- run: cp tools/deploy.gitignore .gitignore
- name: Deploy to Pages 🚀
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: .
- name: Deploy to testing site 🚀
if: github.ref == 'refs/heads/testing'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
clean: false
folder: .
repository-name: ${{ secrets.PARCHMENT_TESTING_REPO }}
token: ${{ secrets.PARCHMENT_TESTING_TOKEN }}