Variables #486
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: Builds, tests & co | |
| on: | |
| pull_request: | |
| paths: | |
| - 'src/**' | |
| - '!src/tools/**' | |
| - 'src_ext/**' | |
| - 'dune' | |
| - 'dune-project' | |
| - '*.opam' | |
| - 'Makefile*' | |
| - 'configure*' | |
| - '.github/scripts/**' | |
| - '.github/workflows/main.yml' | |
| - 'tests/**' | |
| - '!tests/bench/**' | |
| - 'shell/' | |
| push: | |
| branches: | |
| - 'master' | |
| - '2.**' | |
| env: | |
| OPAMBSVERSION: 2.1.0 | |
| OPAMBSROOT: ~/.cache/.opam.cached | |
| OPAM12CACHE: ~/.cache/opam1.2/cache | |
| OPAM_REPO: https://github.com/ocaml/opam-repository.git | |
| OPAM_TEST_REPO_SHA: 3dab8c734b15bf2b5c1d8b99bb134f51361a6bee | |
| OPAM_REPO_SHA: 3dab8c734b15bf2b5c1d8b99bb134f51361a6bee | |
| SOLVER: | |
| CYGWIN_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ | |
| CYGWIN_ROOT: D:\cygwin | |
| CYGWIN: winsymlinks:native | |
| CYGWIN_EPOCH: 4 | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| #### | |
| # Caches | |
| #### | |
| Analyse: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| archives: ${{ steps.keys.outputs.archives }} | |
| ocaml-cache: ${{ steps.keys.outputs.ocaml-cache }} | |
| cygwin: ${{ steps.keys.outputs.cygwin }} | |
| opam-bs-cache: ${{ steps.keys.outputs.opam-bs-cache }} | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: Determine cache keys | |
| id: keys | |
| run: | | |
| echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} | |
| echo archives=archives-1-${{ hashFiles('src_ext/Makefile.dune', 'src_ext/Makefile.sources', 'src_ext/Makefile', '.github/scripts/common/preamble.sh', '.github/scripts/main/preamble.sh', '.github/scripts/main/archives-cache.sh') }}-${{ env.OPAM_REPO_SHA }} >> $GITHUB_OUTPUT | |
| echo ocaml-cache=${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh') }} | |
| echo ocaml-cache=${{ hashFiles('src_ext/Makefile.dune', '.github/scripts/main/ocaml-cache.sh', '.github/scripts/main/preamble.sh') }} >> $GITHUB_OUTPUT | |
| echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }} | |
| echo cygwin=${{ hashFiles('.github/scripts/cygwin.cmd') }}-${{ env.CYGWIN_EPOCH }} >> $GITHUB_OUTPUT | |
| echo opam-bs-cache=${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }} | |
| echo opam-bs-cache=${{ hashFiles('.github/scripts/main/opam-bs-cache.sh', '*.opam', '.github/scripts/main/preamble.sh') }} >> $GITHUB_OUTPUT | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ steps.keys.outputs.archives }} | |
| lookup-only: true | |
| enableCrossOsArchive: true | |
| - name: Create src_ext/archives and opam-repository cache | |
| if: steps.archives.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/archives-cache.sh | |
| Cygwin: | |
| runs-on: windows-2022 | |
| needs: Analyse | |
| steps: | |
| - name: Cygwin64 Cache | |
| id: cygwin64 | |
| uses: actions/cache@v4 | |
| with: | |
| path: D:\Cache\cygwin\x86_64-pc-cygwin | |
| key: cygwin64-${{ needs.Analyse.outputs.cygwin }} | |
| lookup-only: true | |
| enableCrossOsArchive: true | |
| - name: Checkout tree | |
| if: steps.cygwin64.outputs.cache-hit != 'true' | |
| uses: actions/checkout@v5 | |
| - name: Create Cygwin64 cache | |
| if: steps.cygwin64.outputs.cache-hit != 'true' | |
| shell: cmd | |
| run: .github\scripts\cygwin.cmd x86_64-pc-cygwin D:\Cache\cygwin create | |
| #### | |
| # Build | |
| #### | |
| Build-Linux: | |
| runs-on: ubuntu-latest | |
| needs: Analyse | |
| strategy: | |
| matrix: | |
| ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 5.0.0, 5.1.1, 5.2.1, 4.14.2, 5.3.0 ] | |
| fail-fast: true | |
| steps: | |
| - name: Install bubblewrap | |
| run: sudo apt install bubblewrap | |
| - name: Disable AppArmor | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: Build | |
| run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu | |
| - name: Test (basic) | |
| run: bash -exu .github/scripts/main/test.sh | |
| Build-Windows: | |
| runs-on: windows-2022 | |
| needs: [ Analyse, Cygwin ] | |
| strategy: | |
| matrix: | |
| include: | |
| - host: x86_64-pc-cygwin | |
| build: x86_64-pc-cygwin | |
| ocamlv: 4.14.2 | |
| - host: i686-w64-mingw32 | |
| build: x86_64-pc-cygwin | |
| ocamlv: 4.14.2 | |
| - host: x86_64-w64-mingw32 | |
| build: x86_64-pc-cygwin | |
| ocamlv: 4.14.2 | |
| - host: i686-pc-windows | |
| build: x86_64-pc-cygwin | |
| ocamlv: 4.14.2 | |
| - host: x86_64-pc-windows | |
| build: x86_64-pc-cygwin | |
| ocamlv: 4.14.2 | |
| - host: x86_64-w64-mingw32 | |
| build: x86_64-pc-cygwin | |
| ocamlv: 5.3.0 | |
| - host: x86_64-pc-windows | |
| build: x86_64-pc-cygwin | |
| ocamlv: 5.3.0 | |
| fail-fast: false | |
| defaults: | |
| run: | |
| shell: D:\cygwin\bin\bash.exe {0} | |
| steps: | |
| - name: Configure LF checkout for Cygwin | |
| if: endsWith(matrix.host, '-pc-cygwin') | |
| shell: cmd | |
| run: | | |
| git config --system core.autocrlf false | |
| git config --system core.eol lf | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: Cygwin64 Cache | |
| id: cygwin64 | |
| if: matrix.build == 'x86_64-pc-cygwin' | |
| uses: actions/cache@v4 | |
| with: | |
| path: D:\Cache\cygwin\x86_64-pc-cygwin | |
| key: cygwin64-${{ needs.Analyse.outputs.cygwin }} | |
| enableCrossOsArchive: true | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: D:\Cache\ocaml-local | |
| key: ${{ runner.os }}-${{ matrix.host }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| enableCrossOsArchive: true | |
| - name: Unpack Cygwin | |
| shell: cmd | |
| run: .github\scripts\cygwin.cmd ${{ matrix.build }} D:\Cache\cygwin ${{ matrix.host }} | |
| - name: Cygwin info | |
| run: uname -a | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} ${{ matrix.host }} | |
| - name: Build | |
| run: bash -exu .github/scripts/main/main.sh ${{ matrix.host }} | |
| - name: Test "static" binaries on Windows | |
| if: endsWith(matrix.host, '-pc-cygwin') == false | |
| run: ldd ./opam.exe | test "$(grep -v -F /cygdrive/c/Windows/)" = '' | |
| - name: Upload opam binaries for Windows | |
| if: endsWith(matrix.host, '-pc-windows') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: opam-exe-${{ matrix.host }}-${{ matrix.ocamlv }}-${{ matrix.build }} | |
| path: | | |
| D:\Local\bin\opam.exe | |
| D:\Local\bin\opam-installer.exe | |
| D:\Local\bin\opam-putenv.exe | |
| - name: Test (basic - Cygwin) | |
| if: endsWith(matrix.host, '-pc-cygwin') | |
| run: bash -exu .github/scripts/main/test.sh | |
| - name: Test (basic - native Windows) | |
| env: | |
| OPAMROOT: D:\a\opam\opam\.opam | |
| if: endsWith(matrix.host, '-pc-cygwin') == false | |
| shell: cmd | |
| run: | | |
| set Path=D:\Cache\ocaml-local\bin;%Path% | |
| if "${{ matrix.host }}" equ "x86_64-pc-windows" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| if "${{ matrix.host }}" equ "i686-pc-windows" call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" | |
| opam init --yes --bare default git+file://%cd%/../../../opam-repository#${{ env.OPAM_TEST_REPO_SHA }} --no-git-location || exit /b 1 | |
| opam switch --yes create default ocaml-system || exit /b 1 | |
| opam env || exit /b 1 | |
| opam install --yes lwt || exit /b 1 | |
| opam list || exit /b 1 | |
| opam config report || exit /b 1 | |
| - name: Test (reftests) | |
| run: bash -exu .github/scripts/main/reftests.sh ${{ matrix.host }} | |
| Build-macOS: | |
| runs-on: macos-latest | |
| needs: Analyse | |
| strategy: | |
| matrix: | |
| ocamlv: [ 4.14.2, 5.3.0 ] | |
| fail-fast: true | |
| steps: | |
| - name: Install GNU patch | |
| run: brew install gpatch | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: Build | |
| run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin | |
| - name: Test (basic) | |
| run: bash -exu .github/scripts/main/test.sh | |
| #### | |
| # Opam tests | |
| #### | |
| Test-Linux: | |
| runs-on: ubuntu-latest | |
| needs: [ Analyse, Build-Linux ] | |
| strategy: | |
| matrix: | |
| ocamlv: [ 4.14.2, 5.3.0 ] | |
| fail-fast: false | |
| env: | |
| OPAM_TEST: 1 | |
| GITHUB_PR_USER: ${{ github.event.pull_request.user.login }} | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: Install bubblewrap | |
| run: sudo apt install bubblewrap | |
| - name: Disable AppArmor | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: opam bootstrap Cache | |
| id: opam-bootstrap | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env.OPAMBSROOT }}/** | |
| ~/.cache/opam-local/bin/** | |
| key: opam-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} | |
| - name: Create opam bootstrap cache | |
| if: steps.opam-bootstrap.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/opam-bs-cache.sh | |
| - name: opam-rt Cache | |
| id: opam-rt | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/opam-rt/** | |
| key: ${{ runner.os }}-opam-rt-${{ matrix.ocamlv }} | |
| - name: Build (and test) | |
| run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu | |
| - name: Test (opam-rt) | |
| run: bash -exu .github/scripts/main/opam-rt.sh | |
| Test-macOS: | |
| runs-on: macos-latest | |
| needs: Analyse | |
| strategy: | |
| matrix: | |
| ocamlv: [ 4.14.2, 5.3.0 ] | |
| fail-fast: false | |
| env: | |
| OPAM_TEST: 1 | |
| GITHUB_PR_USER: ${{ github.event.pull_request.user.login }} | |
| steps: | |
| - name: Install gnu coreutils | |
| run: brew install coreutils gpatch rsync | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: opam bootstrap Cache | |
| id: opam-bootstrap | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env.OPAMBSROOT }}/** | |
| ~/.cache/opam-local/bin/** | |
| key: opam-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} | |
| - name: Create opam bootstrap cache | |
| if: steps.opam-bootstrap.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/opam-bs-cache.sh | |
| - name: opam-rt Cache | |
| id: opam-rt | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/opam-rt/** | |
| key: ${{ runner.os }}-opam-rt-${{ matrix.ocamlv }} | |
| - name: Build (and test) | |
| run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin | |
| - name: Test (opam-rt) | |
| run: bash -exu .github/scripts/main/opam-rt.sh | |
| #### | |
| # Opam cold | |
| #### | |
| Cold-Linux: | |
| runs-on: ubuntu-latest | |
| needs: [ Analyse, Build-Linux ] | |
| env: | |
| OPAM_COLD: 1 | |
| steps: | |
| - name: Install bubblewrap | |
| run: sudo apt install bubblewrap | |
| - name: Disable AppArmor | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: Cold | |
| run: | | |
| make compiler | |
| bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu | |
| - name: Test (basic) | |
| run: bash -exu .github/scripts/main/test.sh | |
| #### | |
| # Compile doc | |
| #### | |
| Doc-Linux: | |
| runs-on: ubuntu-latest | |
| needs: [ Analyse, Build-Linux ] | |
| strategy: | |
| matrix: | |
| ocamlv: [ 4.14.2, 5.3.0 ] | |
| fail-fast: false | |
| env: | |
| OPAM_DOC: 1 | |
| steps: | |
| - name: Install bubblewrap | |
| run: sudo apt install bubblewrap | |
| - name: Disable AppArmor | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - name: Install man2html | |
| run: sudo apt install man2html | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: opam bootstrap Cache | |
| id: opam-bootstrap | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env.OPAMBSROOT }}/** | |
| ~/.cache/opam-local/bin/** | |
| key: opamdoc-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} | |
| - name: Create opam bootstrap cache | |
| if: steps.opam-bootstrap.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/opam-bs-cache.sh | |
| - name: Compile | |
| env: | |
| BASE_REF_SHA: ${{ github.event.pull_request.base.sha }} | |
| PR_REF_SHA: ${{ github.event.pull_request.head.sha }} | |
| run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu | |
| #### | |
| # Compile solver backends | |
| #### | |
| Solvers-Linux: | |
| runs-on: ubuntu-latest | |
| needs: [ Analyse, Build-Linux ] | |
| strategy: | |
| matrix: | |
| solver: [ z3, 0install ] | |
| ocamlv: [ 4.14.2, 5.3.0 ] | |
| fail-fast: false | |
| env: | |
| SOLVER: ${{ matrix.solver }} | |
| OPAMBSROOT: ~/.cache/opam.${{ matrix.solver }}.cached | |
| steps: | |
| - name: Install bubblewrap | |
| run: sudo apt install bubblewrap | |
| - name: Disable AppArmor | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: opam bootstrap Cache | |
| id: opam-bootstrap | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env.OPAMBSROOT }}/** | |
| ~/.cache/opam-local/bin/** | |
| key: opam-${{ matrix.solver }}-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} | |
| - name: Create opam bootstrap cache | |
| if: steps.opam-bootstrap.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/opam-bs-cache.sh | |
| - name: Compile | |
| run: bash -exu .github/scripts/main/solvers.sh | |
| Solvers-macOS: | |
| runs-on: macos-latest | |
| needs: [ Analyse, Build-macOS ] | |
| strategy: | |
| matrix: | |
| solver: [ z3, 0install ] | |
| ocamlv: [ 4.14.2, 5.3.0 ] | |
| fail-fast: false | |
| env: | |
| SOLVER: ${{ matrix.solver }} | |
| OPAMBSROOT: ~/.cache/opam.${{ matrix.solver }}.cached | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: opam bootstrap Cache | |
| id: opam-bootstrap | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env.OPAMBSROOT }}/** | |
| ~/.cache/opam-local/bin/** | |
| key: opam-${{ matrix.solver }}-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} | |
| - name: Create opam bootstrap cache | |
| if: steps.opam-bootstrap.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/opam-bs-cache.sh | |
| - name: Compile | |
| run: bash -exu .github/scripts/main/solvers.sh | |
| #### | |
| # Upgrade from 1.2 to current | |
| #### | |
| Upgrade-Linux: | |
| runs-on: ubuntu-latest | |
| needs: [ Analyse, Build-Linux ] | |
| strategy: | |
| matrix: | |
| ocamlv: [ 4.14.2, 5.3.0 ] | |
| fail-fast: false | |
| steps: | |
| - name: Install bubblewrap | |
| run: sudo apt install bubblewrap | |
| - name: Disable AppArmor | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: opam 1.2 root Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.OPAM12CACHE }} | |
| key: ${{ runner.os }}-opam1.2-root | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: Build | |
| env: | |
| OPAM_UPGRADE: 1 | |
| run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu | |
| - name: Test (upgrade) | |
| run: bash -exu .github/scripts/main/upgrade.sh | |
| Upgrade-macOS: | |
| runs-on: macos-latest | |
| needs: [ Analyse, Build-macOS ] | |
| strategy: | |
| matrix: | |
| ocamlv: [ 4.14.2, 5.3.0 ] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: opam 1.2 root Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.OPAM12CACHE }} | |
| key: ${{ runner.os }}-opam1.2-root | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: Build | |
| env: | |
| OPAM_UPGRADE: 1 | |
| run: bash -exu .github/scripts/main/main.sh x86_64-apple-darwin | |
| - name: Test (upgrade) | |
| run: bash -exu .github/scripts/main/upgrade.sh | |
| #### | |
| # Around opam tests | |
| #### | |
| Hygiene: | |
| runs-on: ubuntu-22.04 | |
| needs: Analyse | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: Get changed files | |
| id: files | |
| if: github.event_name == 'pull_request' | |
| uses: Ana06/[email protected] | |
| with: | |
| filter: | | |
| configure.ac | |
| shell/install.sh | |
| src_ext/** | |
| .github/workflows/** | |
| - name: Install system's dune and ocaml packages | |
| if: steps.files.outputs.all != '' | |
| run: sudo apt install dune ocaml | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| if: steps.files.outputs.all != '' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: Hygiene | |
| env: | |
| BASE_REF_SHA: ${{ github.event.pull_request.base.sha }} | |
| PR_REF_SHA: ${{ github.event.pull_request.head.sha }} | |
| if: steps.files.outputs.all != '' | |
| run: bash -exu .github/scripts/main/hygiene.sh | |
| Depends-Linux: | |
| runs-on: ubuntu-latest | |
| needs: [ Analyse, Build-Linux ] | |
| strategy: | |
| matrix: | |
| ocamlv: [ 4.14.2, 5.3.0 ] | |
| fail-fast: false | |
| env: | |
| OPAM_DEPENDS: 1 | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v5 | |
| - name: Get changed files | |
| id: files | |
| if: github.event_name == 'pull_request' | |
| uses: Ana06/[email protected] | |
| with: | |
| filter: src/**/*.mli | |
| - name: src_ext/archives and opam-repository Cache | |
| id: archives | |
| if: steps.files.outputs.all != '' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| src_ext/archives | |
| ~/opam-repository | |
| key: ${{ needs.Analyse.outputs.archives }} | |
| enableCrossOsArchive: true | |
| - name: Install bubblewrap | |
| if: steps.files.outputs.all != '' | |
| run: sudo apt install bubblewrap | |
| - name: Disable AppArmor | |
| if: steps.files.outputs.all != '' | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - name: OCaml ${{ matrix.ocamlv }} Cache | |
| id: ocaml-cache | |
| if: steps.files.outputs.all != '' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ocaml-local/** | |
| key: ${{ runner.os }}-ocaml-${{ matrix.ocamlv }}-${{ needs.Analyse.outputs.ocaml-cache }} | |
| - name: Create OCaml ${{ matrix.ocamlv }} cache | |
| if: steps.files.outputs.all != '' && steps.ocaml-cache.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} | |
| - name: opam bootstrap Cache | |
| id: opam-bootstrap | |
| if: steps.files.outputs.all != '' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ env.OPAMBSROOT }}/** | |
| ~/.cache/opam-local/bin/** | |
| key: opamdepends-${{ runner.os }}-${{ env.OPAMBSVERSION }}-${{ matrix.ocamlv }}-${{ env.OPAM_REPO_SHA }}-${{ needs.Analyse.outputs.opam-bs-cache }} | |
| - name: Create opam bootstrap cache | |
| if: steps.files.outputs.all != '' && steps.opam-bootstrap.outputs.cache-hit != 'true' | |
| run: bash -exu .github/scripts/main/opam-bs-cache.sh | |
| - name: Compile | |
| env: | |
| BASE_REF_SHA: ${{ github.event.pull_request.base.sha }} | |
| PR_REF_SHA: ${{ github.event.pull_request.head.sha }} | |
| GITHUB_PR_USER: ${{ github.event.pull_request.user.login }} | |
| JOB_URL: ${{ steps.get-job-id.outputs.job_url }} | |
| FAIL_IF_DEPENDENT: opam-publish opam-rt opam-build opam-test | |
| if: steps.files.outputs.all != '' | |
| run: bash -exu .github/scripts/main/main.sh x86_64-pc-linux-gnu |