From 85aef733c81fbbf18c395ea26317d459f23db444 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 15 Jul 2024 10:23:14 +0000 Subject: [PATCH] Fix build on GitHub Actions after removal macos-11 runners - generalize 'topics/test-gha' to 'test-gha/*' - upgrade to building on macos-12 - check on ubuntu-24.04 - don't fail-fast the checks - don't check on macos-14: it's an M1 runner and ORTools 8.2 don't support ARM - don't build Boost (not used anymore) --- ...branch.yml => build-test-gha-branches.yml} | 61 ++++++++++++++----- 1 file changed, 45 insertions(+), 16 deletions(-) rename .github/workflows/{build-topics-test-gha-branch.yml => build-test-gha-branches.yml} (80%) diff --git a/.github/workflows/build-topics-test-gha-branch.yml b/.github/workflows/build-test-gha-branches.yml similarity index 80% rename from .github/workflows/build-topics-test-gha-branch.yml rename to .github/workflows/build-test-gha-branches.yml index 33c6c6fb..bfd940b3 100644 --- a/.github/workflows/build-topics-test-gha-branch.yml +++ b/.github/workflows/build-test-gha-branches.yml @@ -2,7 +2,7 @@ name: Test building on GitHub Actions on: push: branches: - - topics/test-gha + - test-gha/* jobs: build-for-linux: runs-on: ubuntu-20.04 @@ -30,12 +30,7 @@ jobs: tar xf boost_*.tar.gz rm boost_*.tar.gz cd boost_* - echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam - ./bootstrap.sh - ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage sudo cp -r boost /usr/local/include - sudo cp -r stage/lib/* /usr/local/lib - sudo ldconfig - name: Install OR-Tools run: | cd /home/runner/work @@ -109,12 +104,8 @@ jobs: rm boost_*.tar.gz mv boost_* boost cd boost - echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam - ./bootstrap.bat - ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage || true mkdir -p /d/lincs-deps/include /d/lincs-deps/lib cp -r boost /d/lincs-deps/include - cp -r stage/lib/* /d/lincs-deps/lib - name: Install OR-Tools shell: msys2 {0} run: | @@ -141,12 +132,12 @@ jobs: run: twine check (get-item dist\*.whl) build-for-macos: - runs-on: macos-11 + runs-on: macos-12 strategy: matrix: python_version: ['3.8', '3.12'] env: - MACOSX_DEPLOYMENT_TARGET: 11.0 + MACOSX_DEPLOYMENT_TARGET: 12.0 steps: - name: Install Python uses: actions/setup-python@v5 @@ -170,11 +161,7 @@ jobs: tar xf boost_*.tar.gz rm boost_*.tar.gz cd boost_* - echo "using python : ${{ matrix.python_version }} ;" >tools/build/src/user-config.jam - ./bootstrap.sh - ./b2 --with-python python=${{ matrix.python_version }} link=shared variant=release stage sudo cp -r boost /usr/local/include - sudo cp -r stage/lib/* /usr/local/lib - name: Install OR-Tools run: | cd /Users/runner/work @@ -194,3 +181,45 @@ jobs: run: delocate-wheel --wheel-dir dist local-dist/*.whl - name: Check the wheel run: twine check dist/*.whl + + check: + runs-on: ${{ matrix.os }} + needs: + - build-for-linux + - build-for-windows + - build-for-macos + strategy: + fail-fast: false + matrix: + os: + - ubuntu-20.04 + - ubuntu-22.04 + - ubuntu-24.04 + - windows-2019 + - windows-2022 + - macos-12 + - macos-13 + python_version: ['3.8', '3.12'] + steps: + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python_version }} + # DO NOT install any other dependencies, to test that the wheels are self-contained + + - name: Dowload the wheels from GitHub Actions artifacts + uses: actions/download-artifact@v4 + with: + pattern: wheel-dist-${{ matrix.python_version }}-* + merge-multiple: true + + - name: Install the wheel + run: pip${{ matrix.python_version }} install --find-links . --pre lincs + + - name: Run lincs + run: lincs --help + - run: lincs generate classification-problem 3 2 --output-problem problem.yml + - run: lincs generate classification-model problem.yml --output-model model.yml + - run: lincs generate classified-alternatives problem.yml model.yml 100 --output-alternatives learning-set.csv + - run: lincs learn classification-model problem.yml learning-set.csv --output-model learned-model.yml + - run: lincs classification-accuracy problem.yml learned-model.yml learning-set.csv