From d29f726df8c5990390b09afe8220e0738d517211 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 | 102 ++++++++++++++++++++++++++++++++++-- 2 files changed, 103 insertions(+), 5 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..d01c672 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,14 +34,94 @@ 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 }} env: SKIP_BUILD: | + camlimages dose lilis rotor + freetds + genprint + hdf5 + ocp-index-top + pa_ppx + pla + ppx_deriving_rpc + reed-solomon-erasure + setr + uwt SKIP_TEST: | 0install bisect_ppx @@ -53,12 +137,19 @@ 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 +161,19 @@ 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') + shell: bash run: | PACKAGES=`opam list -s --color=never --installable --depends-on cppo,cppo_ocamlbuild` echo "Dependants:" $PACKAGES