-
Notifications
You must be signed in to change notification settings - Fork 6
92 lines (83 loc) · 2.89 KB
/
pythonapp.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Python application
on: [push, pull_request]
jobs:
pretest:
name: AMS Pretest
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/misc' }}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.11
mamba-version: "*"
miniforge-version: "latest"
channels: conda-forge,defaults
channel-priority: true
activate-environment: anaconda-client-env
- shell: bash -el {0}
name: Install dependencies
run: |
mamba install -y nbmake pytest-xdist line_profiler # add'l packages for notebook tests.
mamba install --file requirements.txt --file requirements-extra.txt
python -m pip install pyscipopt
python -m pip install -e .
- shell: bash -el {0}
name: Run pip check
run: |
pip check || true # Allow pip check to fail without failing the job
- shell: bash -el {0}
name: Test with pytest
run: |
pytest
- shell: bash -el {0}
name: Test notebooks.
run: |
pytest --nbmake examples --ignore=examples/verification
build:
name: AMS Tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, 3.10, 3.11, 3.12, 3.13]
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/misc' }}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.11
mamba-version: "*"
miniforge-version: "latest"
channels: conda-forge,defaults
channel-priority: true
activate-environment: anaconda-client-env
- shell: bash -el {0}
name: Install dependencies
run: |
mamba install -y nbmake pytest-xdist line_profiler # add'l packages for notebook tests.
mamba install --file requirements.txt --file requirements-extra.txt
python -m pip install pyscipopt
python -m pip install -e .
- shell: bash -el {0}
name: Run pip check
run: |
pip check || true # Allow pip check to fail without failing the job
- shell: bash -el {0}
name: Test with pytest
run: |
pytest
- shell: bash -el {0}
name: Test notebooks.
run: |
pytest --nbmake examples --ignore=examples/verification
- name: Build a distribution if tagged
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
run: |
python setup.py sdist
- name: Publish a Python distribution to PyPI if tagged
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}