Skip to content

Merge pull request #321 from insight-lane/setup_tox #125

Merge pull request #321 from insight-lane/setup_tox

Merge pull request #321 from insight-lane/setup_tox #125

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
linux:
env:
PYTHONFAULTHANDLER: "true"
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
# activate-environment: crash-model
# environment-file: conda-linux-64.lock
channels: conda-forge, defaults
channel-priority: strict
- name: Run linux tests
run: |
set -eo pipefail
conda env create --name crash-model -f requirements.txt
conda activate crash-model
cd src
py.test --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./src/coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
mac:
env:
PYTHONFAULTHANDLER: "true"
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
#activate-environment: crash-model
#environment-file: conda-osx-64.lock
#environment-file: environment_mac.yml
channels: conda-forge, defaults
channel-priority: strict
- name: Run mac tests
run: |
set -eo pipefail
. /usr/local/miniconda/etc/profile.d/conda.sh
sudo chown -R $USER $CONDA
conda env create --name crash-model -f requirements.txt
conda activate crash-model
cd src
pytest
# unclear that we need to test on windows
# windows:
# env:
# PYTHONFAULTHANDLER: "true"
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v2
# - uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# #activate-environment: crash-model
# #environment-file: conda-win-64.lock
# channels: conda-forge, defaults
# channel-priority: strict
# - name: Run windows tests
# shell: bash -l {0}
# run: |
# set -eo pipefail
# conda env create --name crash-model -f requirements.txt
# cd src
# py.test