Update environment.yml #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Package using Conda | |
on: [push] | |
env: | |
CODECOV_TOKEN: 5454ef86-3f2b-45a7-8df0-636d3044ae13 | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.8', '3.9'] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
environment-file: environment.yml | |
- name: Conda info | |
shell: bash -l {0} | |
run: conda info | |
- name: Lint with flake8 | |
shell: bash -l {0} | |
run: | | |
conda install flake8 | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Run test suite | |
shell: bash -l {0} | |
run: | | |
conda install pytest | |
pip install pytest-html | |
pip install pytest-cov | |
pip install --upgrade numpy | |
pip install -e . | |
pytest test --html=${{ matrix.python-version }}-results.html --self-contained-html --cov=./ --cov-report=xml | |
- name: Move artifacts | |
shell: bash -l {0} | |
run: mv test.log ${{ matrix.python-version }}-test.log | |
if: always() | |
- uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: ${{ matrix.python-version }}-artifacts | |
path: | | |
${{ matrix.python-version }}-results.html | |
${{ matrix.python-version }}-test.log | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v2 | |
if: always() |