Skip to content

Commit ebc2a27

Browse files
committed
fix #939: test all supported Python versions instead of just Python 3.8 and trigger tests on PR
we use conda-incubator/setup-miniconda instead of the default setup-python action
1 parent b590418 commit ebc2a27

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed
Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,40 @@
1-
name: Python Package using Conda
1+
name: Test LArray
22

3-
on: [push]
3+
# Triggers the workflow on push or pull request events
4+
on: [push, pull_request]
45

56
jobs:
67
build-linux:
8+
# name: Test (${{ matrix.python-version }}, ${{ matrix.os }})
9+
name: Test on ${{ matrix.python-version }}
10+
# runs-on: ${{ matrix.os }}
711
runs-on: ubuntu-latest
812
strategy:
913
max-parallel: 5
14+
fail-fast: false
15+
matrix:
16+
# os: ["ubuntu-latest", "macos-latest", "windows-latest"]
17+
python-version: [3.6, 3.7, 3.8, 3.9]
18+
19+
defaults:
20+
run:
21+
shell: bash -l {0}
1022

1123
steps:
1224
- uses: actions/checkout@v2
13-
- name: Set up Python 3.8
14-
uses: actions/setup-python@v2
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: conda-incubator/setup-miniconda@v2
1527
with:
16-
python-version: 3.8
17-
- name: Add conda to system path
18-
run: |
19-
# $CONDA is an environment variable pointing to the root of the miniconda directory
20-
echo $CONDA/bin >> $GITHUB_PATH
21-
- name: Install dependencies
22-
run: |
23-
conda env update --file environment.yml --name base
24-
- name: Lint with flake8
25-
run: |
26-
conda install flake8
27-
# stop the build if there are Python syntax errors or undefined names
28-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31-
- name: Test with pytest
32-
run: |
33-
conda install pytest
34-
pytest
28+
auto-update-conda: true
29+
environment-file: environment.yml
30+
python-version: ${{ matrix.python-version }}
31+
- run: conda info
32+
- run: conda list
33+
- run: conda config --show
34+
# - name: Lint with flake8
35+
# run: |
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+
- run: pytest

environment.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
name: test-py38
1+
name: test
22
channels:
3-
- larray-project
43
- defaults
54
dependencies:
6-
- python=3.8
75
- pip
86
- numpy>=1.13
97
- pandas>=0.20
@@ -12,5 +10,6 @@ dependencies:
1210
- openpyxl
1311
- xlsxwriter
1412
- pytest>=3.5
13+
- flake8
1514
- pip:
1615
- pytest-flake8

0 commit comments

Comments
 (0)