From 238cb3399412f4eea9daf41b55466520c08a669e Mon Sep 17 00:00:00 2001 From: Dmitriy Kovalenko Date: Thu, 22 Aug 2024 11:50:15 +0200 Subject: [PATCH] X --- .github/workflows/build.yml | 52 ++++++++++++++----------------------- io/config/discover.ml | 6 ++--- 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df3816fd..d4d2a54c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,36 +5,42 @@ on: [push] jobs: build: runs-on: ${{ matrix.os }} + continue-on-error: true strategy: matrix: - os: [windows-latest] + include: + - os: ubuntu-latest + ocaml-compiler: "5.2.0" + triplet: "x64-linux" + - os: windows-latest + ocaml-compiler: "5.2.0" + triplet: "x64-mingw-static" + - os: windows-latest + ocaml-compiler: "arch-x86_64,system-mingw,ocaml.5.2.0" + triplet: "x64-mingw-static" defaults: run: shell: bash steps: - - run: git config --global core.autocrlf input - uses: actions/checkout@v2.3.2 - - shell: bash - run: rm -rf $(which pkg-config) - - run: gcc --version + - if: runner.os == 'Windows' + run: | + rm -rf $(which pkg-config) + choco install pkgconfiglite - - uses: actions/setup-node@v4 - with: - node-version: "20" + - run: gcc --version - uses: lukka/get-cmake@latest - name: Setup anew (or from cache) vcpkg (and does not build any package) uses: lukka/run-vcpkg@v11 env: - VCPKG_DEFAULT_TRIPLET: x64-mingw-static - VCPKG_DEFAULT_HOST_TRIPLET: x64-mingw-static + VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} + VCPKG_DEFAULT_HOST_TRIPLET: ${{ matrix.triplet }} with: runVcpkgInstall: true runVcpkgFormatString: '["install", "--clean-after-build"]' - - run: vcpkg install - - name: Set pkg-config path on Unix if: runner.os != 'Windows' run: | @@ -47,9 +53,6 @@ jobs: run: | echo "PKG_CONFIG_PATH=${GITHUB_WORKSPACE}\vcpkg_installed\\${VCPKG_DEFAULT_TRIPLET}\lib\pkgconfig" >> $GITHUB_ENV - - run: | - choco install pkgconfiglite - - shell: bash run: | echo "LIBPNG_CFLAGS=$(pkg-config --cflags libspng_static)" >> $GITHUB_ENV @@ -61,27 +64,12 @@ jobs: - uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: "arch-x86_64,system-mingw,ocaml.5.2.0" + ocaml-compiler: ${{ matrix.ocaml-compiler }} opam-disable-sandboxing: true dune-cache: false - run: opam exec -- opam install . --deps-only + - name: Install deps & build run: opam exec -- dune build --verbose - - run: opam exec -- dune build --verbose - - - name: Test - run: esy test - - - name: Test node bindings - run: esy test-js - - - name: Test ts declaration - run: esy test-ts - - - uses: actions/upload-artifact@v2 - if: failure() - with: - name: orange_diff_generated - path: test/test-images diff --git a/io/config/discover.ml b/io/config/discover.ml index ccddbfb2..caf3232e 100644 --- a/io/config/discover.ml +++ b/io/config/discover.ml @@ -103,9 +103,9 @@ let get_flags_from_env_or_run_pkg_conifg c ~env ~lib = let c_flags_to_ocaml_opt_flags flags = flags - |> List.map (function - | opt when String.starts_with opt ~prefix:"-l" -> [ "-cclib"; opt ] - | opt -> [ "-ccopt"; opt ]) + |> List.filter_map (function + | opt when String.starts_with opt ~prefix:"-l" -> Some [ "-cclib"; opt ] + | _ -> None) |> List.flatten let () =