Skip to content

Commit 8a6bc7a

Browse files
authored
Create python-package-conda.yml
1 parent cdad457 commit 8a6bc7a

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Python Package using Conda
2+
3+
on: [push]
4+
5+
jobs:
6+
build-linux:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 5
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Install Miniconda
14+
run: |
15+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
16+
bash miniconda.sh -b -p $HOME/miniconda
17+
echo "$HOME/miniconda/bin" >> $GITHUB_PATH
18+
source $HOME/miniconda/bin/activate
19+
conda init bash
20+
source ~/.bashrc
21+
- uses: actions/checkout@v4
22+
- name: Set up Python 3.10
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: '3.10'
26+
- name: Add conda to system path
27+
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
31+
run: |
32+
conda env update --file environment.yml --name base
33+
- name: Lint with flake8
34+
run: |
35+
conda install flake8
36+
# stop the build if there are Python syntax errors or undefined names
37+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
39+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
40+
- name: Test with pytest
41+
run: |
42+
conda install pytest
43+
pytest

0 commit comments

Comments
 (0)