selected old versions of packages to have gh tester run against when … #350
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ['3.9', '3.10', '3.11'] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# rationale: we test against an environment which had | ||
# current packages as of ~ Q4 2022 for python 3.10 | ||
# and ~ Q4 2021 for python 3.9 | ||
# we only install the base packages here (pip below figures out the others) | ||
- name: If running on old python install some old dependencies | ||
if: ${{ matrix.python-version == '3.10'}} | ||
run: python -m pip install numpy==1.23.4 scipy==1.9.3 cvxpy==1.2.3 pandas==1.5.0 osqp==0.6.2.post9 ecos==2.0.12 scs==3.2.2 | ||
- name: Install package | ||
run: | | ||
pip install . | ||
pip install coverage | ||
- name: Run tests with coverage | ||
run: | | ||
coverage run -m unittest discover cvxportfolio | ||
coverage lcov | ||
- name: Coveralls GitHub Action | ||
uses: coverallsapp/github-action@v1 | ||
with: | ||
path-to-lcov: coverage.lcov | ||