| name: CI |
| |
| on: |
| push: |
| branches: [ main ] |
| pull_request: |
| branches: [ main ] |
| |
| # Allows you to run this workflow manually from the Actions tab |
| workflow_dispatch: |
| |
| jobs: |
| ref-interpreter: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| - name: Setup OCaml |
| uses: ocaml/setup-ocaml@v2 |
| with: |
| ocaml-compiler: 4.12.x |
| - run: opam install --yes ocamlbuild.0.14.0 |
| - name: Setup Node.js |
| uses: actions/setup-node@v1 |
| with: |
| node-version: 18.x |
| - run: cd interpreter && opam exec make all |
| |
| ref-interpreter-js-library: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| - name: Setup OCaml |
| uses: ocaml/setup-ocaml@v2 |
| with: |
| ocaml-compiler: 4.12.x |
| - run: opam install --yes ocamlbuild.0.14.0 ocamlfind.1.9.5 js_of_ocaml.4.0.0 js_of_ocaml-ppx.4.0.0 |
| - run: cd interpreter && opam exec make wast.js |
| |
| build-js-api-spec: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| - run: pip install bikeshed && bikeshed update |
| - run: bikeshed spec "document/js-api/index.bs" "document/js-api/index.html" |
| - uses: actions/upload-artifact@v2 |
| with: |
| name: js-api-rendered |
| path: document/js-api/index.html |
| |
| build-web-api-spec: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| - run: pip install bikeshed && bikeshed update |
| - run: bikeshed spec "document/web-api/index.bs" "document/web-api/index.html" |
| - uses: actions/upload-artifact@v2 |
| with: |
| name: web-api-rendered |
| path: document/web-api/index.html |
| |
| build-core-spec: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| with: |
| submodules: "recursive" |
| - run: pip install bikeshed && bikeshed update |
| - run: pip install six |
| - run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended |
| - run: pip install sphinx==5.1.0 |
| - run: cd document/core && make all |
| - uses: actions/upload-artifact@v2 |
| with: |
| name: core-api-rendered |
| path: document/core/_build/html |
| |
| publish-spec: |
| runs-on: ubuntu-latest |
| needs: [build-core-spec, build-js-api-spec, build-web-api-spec] |
| steps: |
| - uses: actions/checkout@v2 |
| - run: mkdir _output && cp document/index.html _output/index.html |
| - uses: actions/download-artifact@v2 |
| with: |
| name: js-api-rendered |
| path: _output/js-api |
| - uses: actions/download-artifact@v2 |
| with: |
| name: web-api-rendered |
| path: _output/web-api |
| - uses: actions/download-artifact@v2 |
| with: |
| name: core-api-rendered |
| path: _output/core |
| - name: Publish HTML to GitHub Pages |
| if: github.ref == 'refs/heads/main' |
| uses: peaceiris/actions-gh-pages@v3 |
| with: |
| publish_dir: ./_output |
| github_token: ${{ secrets.GITHUB_TOKEN }} |