Skip to content

test-suite

test-suite #2437

Workflow file for this run

# This the main GridPath CI workflow
# It installs Cbc and Python dependencies, runs the GridPath test suite with coverage,
# and sends coverage results to coveralls
# We run this on Linux, MacOS, and Windows with Python 3.11, 3.12, and 3.13
name: test-suite
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
- cron: "0 17 * * *"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
python-version: [ "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v3
- name: Install sqlite3 3.45.0 on Linux
if: startsWith(runner.os, 'Linux')
run: |
bash ./.github/workflows/upgrade_sqlite_on_linux.sh
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Cbc and check version (Linux)
if: startsWith(runner.os, 'Linux')
run: |
sudo apt-get install coinor-cbc
sudo apt-get install -y apt-show-versions
apt-show-versions coinor-cbc
- name: Install Cbc (MacOS)
if: startsWith(runner.os, 'macOS')
run: |
brew tap coin-or-tools/coinor
brew install coin-or-tools/coinor/cbc
echo "/opt/homebrew/opt/cbc/bin" >> $GITHUB_PATH
- name: Install Cbc (Windows)
if: startsWith(runner.os, 'Windows')
run: |
bash ./.github/workflows/get_cbc_on_windows.sh
shell: powershell
- name: Verify PATH update
if: startsWith(runner.os, 'Windows')
run: Get-Command cbc.exe
shell: powershell
- name: Install Python dependencies
run: |
python -m pip install .[coverage] --upgrade pip
- name: Test GridPath w/o coverage on all but Linux with Python 3.13
if: ${{ runner.os == 'Windows' || runner.os == 'macOS' || matrix.python-version != '3.13' }}
run: |
python -m unittest discover tests
- name: Test GridPath with coverage
if: ${{ runner.os == 'Linux' && matrix.python-version == '3.13' }}
run: |
coverage run -m unittest discover tests
- name: Send coverage results to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ runner.os == 'Linux' && matrix.python-version == '3.13' }}
run: |
coveralls --service=github