From 5636cac85739d4b75f0cfb2e881c26562657c8e5 Mon Sep 17 00:00:00 2001 From: Yishuai Li Date: Thu, 25 May 2023 16:16:04 +0800 Subject: [PATCH] Pick the right setup for version matrix --- .github/dependabot.yml | 6 ++ .github/workflows/build.yml | 109 +++++++++++++++++++++++++++++++++--- 2 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ca79ca5 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6072534..14451a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,11 @@ jobs: strategy: fail-fast: false matrix: + setup-version: + - v2 + - v3 os: + - macos-13 - macos-latest - ubuntu-latest - windows-latest @@ -30,6 +34,75 @@ jobs: - 4.11.x - 4.12.x - 4.13.x + - 4.14.x + - 5.0.x + - 5.1.x + - 5.2.x + exclude: + - os: macos-13 + setup-version: v3 # opam uninstall fails + - os: macos-latest + setup-version: v2 + - os: macos-latest + ocaml-version: 4.02.x + - os: macos-latest + ocaml-version: 4.03.x + - os: macos-latest + ocaml-version: 4.04.x + - os: macos-latest + ocaml-version: 4.05.x + - os: macos-latest + ocaml-version: 4.06.x + - os: macos-latest + ocaml-version: 4.07.x + - os: macos-latest + ocaml-version: 4.08.x + - os: macos-latest + ocaml-version: 4.09.x + - os: macos-latest + ocaml-version: 4.11.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.02.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.03.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.04.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.05.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.06.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.07.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.08.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.09.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.10.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.11.x + - os: windows-latest + setup-version: v3 + ocaml-version: 4.12.x + - os: windows-latest + setup-version: v2 + ocaml-version: 5.0.x + - os: windows-latest + setup-version: v2 + ocaml-version: 5.1.x + - os: windows-latest + setup-version: v2 + ocaml-version: 5.2.x runs-on: ${{ matrix.os }} @@ -38,6 +111,20 @@ jobs: dose lilis rotor + camlimages + freetds + frenetic + genprint + hdf5 + ocp-index-top + pa_ppx + pla + ppx_deriving_rpc + reed-solomon-erasure + setr + stdcompat + uwt + OPAMAUTOREMOVE: true SKIP_TEST: | 0install bisect_ppx @@ -53,13 +140,20 @@ jobs: git config --global init.defaultBranch master - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Use OCaml ${{ matrix.ocaml-version }} + - name: Setup OCaml ${{ matrix.ocaml-version }} with v2 + if: matrix.setup-version == 'v2' uses: ocaml/setup-ocaml@v2 with: ocaml-compiler: ${{ matrix.ocaml-version }} + - name: Setup OCaml ${{ matrix.ocaml-version }} with v3 + if: matrix.setup-version == 'v3' + uses: ocaml/setup-ocaml@v3 + with: + ocaml-compiler: ${{ matrix.ocaml-version }} + - name: Install dependencies run: opam install --deps-only . @@ -70,18 +164,18 @@ jobs: run: opam exec -- make - name: Upload the build artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-${{ matrix.ocaml-version }}-cppo.exe path: _build/default/src/cppo_main.exe + overwrite: true - name: Build, test, and install package run: opam install -t . - name: Test dependants if: > - (runner.os == 'Linux' && matrix.ocaml-version >= '4.04') || - (runner.os == 'macOS' && matrix.ocaml-version >= '4.13') + (matrix.ocaml-version >= '4.05') && (matrix.os != 'windows-latest') run: | PACKAGES=`opam list -s --color=never --installable --depends-on cppo,cppo_ocamlbuild` echo "Dependants:" $PACKAGES @@ -97,11 +191,8 @@ jobs: echo ::group::Build and test $PACKAGE DEPS_FAILED=false (opam depext $PACKAGE && - opam install --deps-only -t $PACKAGE) || DEPS_FAILED=true + opam install --deps-only $PACKAGE) || DEPS_FAILED=true [ $DEPS_FAILED == false ] && opam install $PACKAGE echo ::endgroup:: [ $DEPS_FAILED == false ] || echo Dependencies broken done - - - name: Uninstall package - run: opam uninstall .