-
Notifications
You must be signed in to change notification settings - Fork 20
46 lines (43 loc) · 1.32 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build and Test
on: [push, pull_request]
# cancels prior builds for this workflow when new commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and run tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout Opty
uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: test-environment
python-version: ${{ matrix.python-version }}
channels: conda-forge
miniforge-variant: Mambaforge
- name: Install basic dependencies
run: |
mamba install -q -y sympy cython scipy cyipopt pytest pytest-cov coverage sphinx matplotlib-base openmp
- name: Install Opty and test import
run: |
python -m pip install .
mamba list
python -c "import opty"
- name: Test with pytest
run: |
mamba list
pytest --cov=opty opty/
- name: Run an example
run: |
python examples/vyasarayani2011.py