Testing #95
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: Testing | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- '*' | |
schedule: | |
- cron: "0 13 * * 1" | |
jobs: | |
build-and-test: | |
name: Testing (${{ matrix.python-version }}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: True | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
activate-environment: dev | |
python-version: ${{ matrix.python-version }} | |
- name: Install Env | |
run: | | |
conda info | |
conda list | |
conda config --show | |
conda install --quiet --yes pip numpy scipy cython mkl pytest pytest-cov mkl-devel | |
- name: Install Our Package | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
echo $CONDA_PREFIX | |
export TEST_COV=1 | |
pip install -v -e . | |
conda list | |
- name: Install Our Package on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
echo $CONDA_PREFIX | |
export MKLROOT="$CONDA_PREFIX\Library" | |
echo $MKLROOT | |
pip install -v -e . | |
conda list | |
- name: Run Tests | |
run: | | |
pytest --cov-config=.coveragerc --cov-report=xml --cov=pydiso -s -v | |
- name: Upload coverage | |
if: ${{ matrix.os == 'ubuntu-latest' }} and {{ matrix.python-version == '3.8' }} | |
uses: codecov/codecov-action@v2 | |
with: | |
verbose: true # optional (default = false) | |
distribute: | |
name: Distributing from 3.8 | |
needs: build-and-test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
activate-environment: dev | |
python-version: 3.8 | |
- name: Install Env | |
run: | | |
conda info | |
conda list | |
conda config --show | |
conda install --quiet --yes pip numpy scipy cython mkl mkl-devel | |
- name: Install Our Package | |
run: | | |
echo $CONDA_PREFIX | |
pip install -v -e . | |
- name: Generate Source Distribution | |
run: | | |
python setup.py sdist | |
- name: pypi-publish | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true |