| name: CI for specs |
| |
| on: |
| push: |
| branches: [ main, wasm-3.0 ] |
| paths: [ .github/**, document/**, spectec/** ] |
| |
| pull_request: |
| branches: [ main, wasm-3.0 ] |
| paths: [ .github/**, document/**, spectec/** ] |
| |
| # Allows you to run this workflow manually from the Actions tab |
| workflow_dispatch: |
| |
| jobs: |
| build-core-spec: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repo |
| uses: actions/checkout@v4 |
| with: |
| submodules: "recursive" |
| - name: Setup OCaml |
| uses: ocaml/setup-ocaml@v3 |
| with: |
| ocaml-compiler: 4.14.x |
| - name: Setup Dune |
| run: opam install --yes dune menhir mdx zarith && opam exec dune --version |
| - name: Setup Node.js |
| uses: actions/setup-node@v4 |
| with: |
| node-version: 16 |
| - name: Setup Bikeshed |
| run: pip install bikeshed && bikeshed update |
| - name: Setup TexLive |
| run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended |
| - name: Setup Sphinx |
| run: pip install six && pip install sphinx==8.1.3 |
| - name: Build SpecTec |
| run: cd spectec && opam exec make |
| - name: Build main spec |
| run: cd document/core && opam exec make main |
| - name: Run Bikeshed |
| run: cd document/core && opam exec make bikeshed |
| - name: Upload artifact |
| uses: actions/upload-artifact@v4 |
| with: |
| name: core-rendered |
| path: document/core/_build/html |
| |
| build-js-api-spec: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repo |
| uses: actions/checkout@v4 |
| - name: Setup Bikeshed |
| run: pip install bikeshed && bikeshed update |
| - name: Run Bikeshed |
| run: bikeshed spec "document/js-api/index.bs" "document/js-api/index.html" |
| - name: Upload artifact |
| uses: actions/upload-artifact@v4 |
| with: |
| name: js-api-rendered |
| path: document/js-api/index.html |
| |
| build-web-api-spec: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repo |
| uses: actions/checkout@v4 |
| - name: Setup Bikeshed |
| run: pip install bikeshed && bikeshed update |
| - name: Run Bikeshed |
| run: bikeshed spec "document/web-api/index.bs" "document/web-api/index.html" |
| - name: Upload artifact |
| uses: actions/upload-artifact@v4 |
| with: |
| name: web-api-rendered |
| path: document/web-api/index.html |
| |
| build-code-metadata-spec: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repo |
| uses: actions/checkout@v4 |
| with: |
| submodules: "recursive" |
| - name: Setup TexLive |
| run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended |
| - name: Setup Sphinx |
| run: pip install six && pip install sphinx==8.1.3 |
| - name: Build main spec |
| run: cd document/metadata/code && make main |
| - name: Upload artifact |
| uses: actions/upload-artifact@v4 |
| with: |
| name: code-metadata-rendered |
| path: document/metadata/code/_build/html |
| |
| build-legacy-exceptions-core-spec: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repo |
| uses: actions/checkout@v4 |
| with: |
| submodules: "recursive" |
| - name: Setup TexLive |
| run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended |
| - name: Setup Sphinx |
| run: pip install six && pip install sphinx==8.1.3 |
| - name: Build main spec |
| run: cd document/legacy/exceptions/core && make main |
| - name: Upload artifact |
| uses: actions/upload-artifact@v4 |
| with: |
| name: legacy-exceptions-core-rendered |
| path: document/legacy/exceptions/core/_build/html |
| |
| build-legacy-exceptions-js-api-spec: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repo |
| uses: actions/checkout@v4 |
| - name: Setup Bikeshed |
| run: pip install bikeshed && bikeshed update |
| - name: Run Bikeshed |
| run: bikeshed spec "document/legacy/exceptions/js-api/index.bs" "document/legacy/exceptions/js-api/index.html" |
| - name: Upload artifact |
| uses: actions/upload-artifact@v4 |
| with: |
| name: legacy-exceptions-js-api-rendered |
| path: document/legacy/exceptions/js-api/index.html |
| |
| build-spec-versions: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repo |
| uses: actions/checkout@v4 |
| - name: Upload artifacts |
| uses: actions/upload-artifact@v4 |
| with: |
| name: versions-rendered |
| path: document/versions/ |
| |
| publish-spec: |
| runs-on: ubuntu-latest |
| needs: |
| - build-js-api-spec |
| - build-legacy-exceptions-core-spec |
| - build-legacy-exceptions-js-api-spec |
| - build-spec-versions |
| steps: |
| - name: Checkout repo |
| uses: actions/checkout@v4 |
| - name: Create output directory |
| run: mkdir _output && cp document/index.html _output/index.html |
| - name: Download JS API spec artifact |
| uses: actions/download-artifact@v4 |
| with: |
| name: js-api-rendered |
| path: _output/js-api |
| - name: Download legacy exceptions core spec artifact |
| uses: actions/download-artifact@v4 |
| with: |
| name: legacy-exceptions-core-rendered |
| path: _output/legacy/exceptions/core |
| - name: Download legacy exceptions JS API spec artifact |
| uses: actions/download-artifact@v4 |
| with: |
| name: legacy-exceptions-js-api-rendered |
| path: _output/legacy/exceptions/js-api |
| - name: Download spec versions artifacts |
| uses: actions/download-artifact@v4 |
| with: |
| name: versions-rendered |
| path: _output/versions |
| - name: Publish to GitHub Pages |
| if: github.ref == 'refs/heads/main' |
| uses: peaceiris/actions-gh-pages@v4 |
| with: |
| publish_dir: ./_output |
| github_token: ${{ secrets.GITHUB_TOKEN }} |