Decode/Encode to the next level #871
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 & Pack | |
| runs-on: ubuntu-24.04 | |
| 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 | |
| # Doesn't work with rescript v12 | |
| # - 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-24.04 | |
| defaults: | |
| run: | |
| working-directory: packages/sury-ppx/src | |
| strategy: | |
| matrix: | |
| ocaml-compiler: | |
| - 5.3.0 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use OCaml ${{ matrix.ocaml-compiler}} | |
| uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-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-linux-arm: | |
| name: ppx-build-linux-arm | |
| runs-on: ubuntu-24.04-arm | |
| defaults: | |
| run: | |
| working-directory: packages/sury-ppx/src | |
| strategy: | |
| matrix: | |
| ocaml-compiler: | |
| - 5.3.0 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use OCaml ${{ matrix.ocaml-compiler}} | |
| uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-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-arm | |
| 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: | |
| - 5.3.0 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use OCaml ${{ matrix.ocaml-compiler}} | |
| uses: ocaml/setup-ocaml@v3 | |
| 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@v4 | |
| 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: | |
| - 5.3.0 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use OCaml ${{ matrix.ocaml-compiler}} | |
| uses: ocaml/setup-ocaml@v3 | |
| 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@v4 | |
| 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-2025 | |
| defaults: | |
| run: | |
| working-directory: packages/sury-ppx/src | |
| strategy: | |
| matrix: | |
| ocaml-compiler: | |
| - 5.3.0 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use OCaml ${{ matrix.ocaml-compiler}} | |
| uses: ocaml/setup-ocaml@v3 | |
| 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@v4 | |
| 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-linux-arm, ppx-build-macos, ppx-build-macos-x64, ppx-build-windows] | |
| runs-on: ubuntu-24.04 | |
| 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 ppx linux-ARM artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ppx-build-linux-arm | |
| path: binaries/linux-arm | |
| - 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/linux-arm/bin.exe packages/sury-ppx/ppx-linux-arm.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-11.0.0-alpha.2.tgz | |
| e2e: | |
| name: E2E Test | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| needs: [ppx-build-linux] | |
| runs-on: ubuntu-24.04 | |
| 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 |