Skip to content

Commit 4885e28

Browse files
Create python-package-conda.yml
1 parent dd72a56 commit 4885e28

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Python Package using Conda
2+
3+
on:
4+
[push]
5+
workflow-dispatch
6+
7+
8+
jobs:
9+
build-linux:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["pypy3.9", "pypy3.10", "3.9", "3.10", "3.11", "3.12"]
14+
max-parallel: 5
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Add conda to system path
23+
run: |
24+
# $CONDA is an environment variable pointing to the root of the miniconda directory
25+
echo $CONDA/bin >> $GITHUB_PATH
26+
- name: Install dependencies
27+
run: |
28+
conda env update --file environment.yml --name base
29+
- name: Lint with flake8
30+
run: |
31+
conda install flake8
32+
# stop the build if there are Python syntax errors or undefined names
33+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36+
- name: Test with pytest
37+
run: |
38+
conda install pytest
39+
pytest

0 commit comments

Comments
 (0)