1- name : Python Package using Conda
1+ name : CI
22
3- on : [push]
3+ on :
4+ push :
5+ branches :
6+ - main
47
58jobs :
6- build_matrix :
9+ test :
10+ name : ${{ matrix.platform}} (${{matrix.python-version)
11+ runs-on : ${{ matrix.os}}
712 strategy :
8- max-parallel : 5
913 fail-fast : false
1014 matrix :
11- python-version : ["3.9", "3.10", "3.11", "3.12", "3.13 "]
15+ python-version : ["3.11 "]
1216 os : [ubuntu-latest, windows-latest, macos-latest]
13- runs-on : ${{ matrix.os }}
1417 defaults :
1518 run :
1619 # Adding -l {0} helps ensure conda can be found properly in windows.
@@ -20,26 +23,40 @@ jobs:
2023 steps :
2124 - uses : actions/checkout@v4
2225 - name : Set up Python ${{ matrix.python-version }}
23- uses : actions/setup-python@v3
26+ uses : actions/setup-python@v5
2427 with :
2528 python-version : ${{ matrix.python-version}}
26- - name : Add conda to system path
29+
30+
31+ - name : Setup Miniforge
32+ uses : conda-incubator/setup-miniconda@v3
33+ with :
34+ miniforge-version : latest
35+ python-version : ${{ matrix.python-version }}
36+ environment-file : environment.yaml
37+ activate-environment : environment.yaml
38+ run-post : false
39+
40+ - name : Conda Info
2741 run : |
28- # $CONDA is an environment variable pointing to the root of the miniconda directory
29- echo $CONDA/bin >> $GITHUB_PATH
30- - name : Install dependencies
42+ conda info -a
43+ conda list
44+ PYVER=`python -c "import sys; print('{:d}.{:d}'.format(sys.version_info.major, sys.version_info.minor))"`
45+ if [[ $PYVER != $PYTHON ]]; then
46+ exit 1;
47+ fi
48+
49+ - name : Install
3150 run : |
32- conda env update --file environment.yaml --name base
33- python -m pip install --upgrade pip
34- pip install flake8
35- pip install -e .
51+ pip install .
52+
3653 - name : Lint with flake8
3754 run : |
38- conda install flake8
3955 # stop the build if there are Python syntax errors or undefined names
4056 flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4157 # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
4258 flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
59+
4360 - name : Test with pytest
4461 run : |
4562 conda install pytest pytest-cov
0 commit comments