Skip to content

implementing online testing for pr #34

implementing online testing for pr

implementing online testing for pr #34

Workflow file for this run

name: Run the tests
on: [pull_request]
env:
PREFIX_WINDOWS: C:\Miniconda3\envs\optistim
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
shard: [1]
name: Tests on ${{ matrix.os }}-shard ${{ matrix.shard }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Set prefix windows
run: |
echo "PREFIX=${{ env.PREFIX_WINDOWS }}" >> $GITHUB_ENV
if: matrix.os == 'windows-latest'
- name: Checkout code
uses: actions/checkout@v3
- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
activate-environment: optistim
environment-file: environment.yml
- name: Print mamba info
run: |
mamba config --show
mamba info
mamba list
# - name: Install bioptim on Windows
# run:
# uses: actions/checkout@v2
# with:
# submodules: bioptim
# python setup.py install
# - name: Install bioptim on Windows
# run: |
# pwd
# cd external/bioptim
# ls
# pwd
# python setup.py install
- name: Install bioptim on Windows
run: |
pwd
cd external
./bioptim_install_windows.sh 4 ${{ env.PREFIX_WINDOWS }}
cd ..
if: matrix.os == 'windows-latest' && matrix.shard == 1
- name: Install extra dependencies
run: mamba install pytest-cov black pytest pytest-cov codecov packaging -cconda-forge
- name: Run tests without code coverage
run: pytest -v --color=yes tests/shard${{ matrix.shard }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}