Skip to content

DEV: fix test and cov report #258

DEV: fix test and cov report

DEV: fix test and cov report #258

Workflow file for this run

name: test
env:
scip-version: 8.0.0
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
jobs:
test:
if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !contains( github.event.head_commit.message, 'Merge pull request')) }}
# Only 20.04 is known to work with scip 8.0.0
runs-on: ubuntu-20.04
strategy:
max-parallel: 10
matrix:
python_version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
wget --quiet --no-check-certificate https://scipopt.org/download/release/SCIPOptSuite-${{ env.scip-version }}-Linux-ubuntu.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.scip-version }}-Linux-ubuntu.deb
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies and package
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-optional.txt
pip install -e .[test]
- name: Test with pytest
run: |
pytest tests --cov=smol --cov-report=xml
- if: matrix.python_version == '3.11'
name: upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage.xml