V11 alpha.2 (#147) #804
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - "v\\d+.\\d+.\\d+-patch" | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| sury: | |
| name: Sury - Build & Test & Lint & Pack | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22.6.0 | |
| cache: "pnpm" | |
| - run: pnpm install | |
| - run: pnpm build | |
| working-directory: packages/sury | |
| - run: pnpm coverage | |
| working-directory: packages/sury | |
| - uses: codecov/codecov-action@v3 | |
| with: | |
| files: packages/sury/coverage/lcov.info | |
| - run: pnpm lint:stdlib | |
| working-directory: packages/sury | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sury | |
| path: packages/sury/artifacts | |
| ppx-build-linux: | |
| name: ppx-build-linux | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: packages/sury-ppx/src | |
| strategy: | |
| matrix: | |
| ocaml-compiler: | |
| - 4.12.1 | |
| container: | |
| image: ocaml/opam:alpine-3.16-ocaml-4.12 | |
| options: --user root | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Opam init | |
| run: opam init -a --disable-sandboxing --compiler=${{ matrix.ocaml-compiler }} | |
| - name: Install deps | |
| run: opam install . --deps-only --with-test | |
| - name: Build | |
| run: opam exec -- dune build --profile static | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ppx-build-linux | |
| path: packages/sury-ppx/src/_build/default/bin/bin.exe | |
| if-no-files-found: error | |
| ppx-build-macos: | |
| name: ppx-build-macos | |
| runs-on: macOS-latest | |
| defaults: | |
| run: | |
| working-directory: packages/sury-ppx/src | |
| strategy: | |
| matrix: | |
| ocaml-compiler: | |
| - 4.12.1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use OCaml ${{ matrix.ocaml-compiler}} | |
| uses: ocaml/setup-ocaml@v2 | |
| with: | |
| ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
| - name: Install deps | |
| run: opam install . --deps-only --with-test | |
| - name: Build | |
| run: opam exec -- dune build | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@master | |
| with: | |
| name: ppx-build-macos | |
| path: packages/sury-ppx/src/_build/default/bin/bin.exe | |
| if-no-files-found: error | |
| ppx-build-macos-x64: | |
| name: ppx-build-macos-x64 | |
| runs-on: macOS-13 | |
| defaults: | |
| run: | |
| working-directory: packages/sury-ppx/src | |
| strategy: | |
| matrix: | |
| ocaml-compiler: | |
| - 4.12.1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use OCaml ${{ matrix.ocaml-compiler}} | |
| uses: ocaml/setup-ocaml@v2 | |
| with: | |
| ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
| - name: Install deps | |
| run: opam install . --deps-only --with-test | |
| - name: Build | |
| run: opam exec -- dune build | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@master | |
| with: | |
| name: ppx-build-macos-x64 | |
| path: packages/sury-ppx/src/_build/default/bin/bin.exe | |
| if-no-files-found: error | |
| ppx-build-windows: | |
| name: ppx-build-windows | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| working-directory: packages/sury-ppx/src | |
| strategy: | |
| matrix: | |
| ocaml-compiler: | |
| - 4.12.1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use OCaml ${{ matrix.ocaml-compiler}} | |
| uses: ocaml/setup-ocaml@v2 | |
| with: | |
| ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
| - name: Install deps | |
| run: opam install . --deps-only --with-test | |
| - name: Build | |
| run: opam exec -- dune build | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@master | |
| with: | |
| name: ppx-build-windows | |
| path: packages/sury-ppx/src/_build/default/bin/bin.exe | |
| if-no-files-found: error | |
| pack-sury-ppx: | |
| name: Pack sury-ppx | |
| needs: [ppx-build-linux, ppx-build-macos, ppx-build-macos-x64, ppx-build-windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22.6.0 | |
| cache: "pnpm" | |
| - run: pnpm install | |
| - name: Download ppx linux artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ppx-build-linux | |
| path: binaries/linux | |
| - name: Download macOS artifacts | |
| uses: actions/download-artifact@master | |
| with: | |
| name: ppx-build-macos | |
| path: binaries/macos | |
| - name: Download macOS x64 artifacts | |
| uses: actions/download-artifact@master | |
| with: | |
| name: ppx-build-macos-x64 | |
| path: binaries/macos-x64 | |
| - name: Download windows artifacts | |
| uses: actions/download-artifact@master | |
| with: | |
| name: ppx-build-windows | |
| path: binaries/windows | |
| - name: Move ppx artifacts | |
| run: | | |
| mv binaries/linux/bin.exe packages/sury-ppx/ppx-linux.exe | |
| mv binaries/macos/bin.exe packages/sury-ppx/ppx-osx.exe | |
| mv binaries/macos-x64/bin.exe packages/sury-ppx/ppx-osx-x64.exe | |
| mv binaries/windows/bin.exe packages/sury-ppx/ppx-windows.exe | |
| - name: npm pack (sury-ppx) | |
| run: npm pack | |
| working-directory: packages/sury-ppx | |
| - name: "Upload artifact: sury-ppx npm package" | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sury-ppx | |
| path: packages/sury-ppx/sury-ppx-10.0.0-rc.6.tgz | |
| e2e: | |
| name: E2E Test | |
| needs: [ppx-build-linux] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v2 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22.6.0 | |
| cache: "pnpm" | |
| - run: pnpm install | |
| - name: Download ppx linux artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ppx-build-linux | |
| path: binaries/linux | |
| - name: Move ppx artifacts | |
| run: | | |
| mv binaries/linux/bin.exe packages/sury-ppx/ppx-linux.exe | |
| - name: Install ppx | |
| run: pnpm ppx:install | |
| working-directory: packages/e2e | |
| - run: pnpm rescript && pnpm test | |
| working-directory: packages/e2e | |
| - name: Run benchmark | |
| working-directory: packages/e2e | |
| run: pnpm benchmark | tee output.txt | |
| - name: Download previous benchmark data | |
| uses: actions/cache@v3 | |
| with: | |
| path: ./cache | |
| key: ${{ runner.os }}-benchmark | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| tool: "benchmarkjs" | |
| output-file-path: packages/e2e/output.txt | |
| external-data-json-path: ./cache/benchmark-data.json | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| alert-threshold: "150%" | |
| comment-always: true | |
| comment-on-alert: true |