Skip to content

Commit

Permalink
Fix build on GitHub Actions after removal macos-11 runners
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
jacquev6 committed Jul 16, 2024
1 parent 4b2b080 commit 85aef73
Showing 1 changed file with 45 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 85aef73

Please sign in to comment.