change the upload conditions. #90
Workflow file for this run
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: | |
- '*' | |
jobs: | |
build-and-test: | |
name: Testing (${{ matrix.python-version }} on ${{ matrix.os }}) with ${{ matrix.solver }}. | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
# NOTE: macOS-13 is the last Intel runner. | |
os: [ubuntu-latest, windows-latest, macOS-13, macOS-latest] | |
solver: [mumps, pardiso] | |
python-version : ['3.10', '3.11', '3.12'] | |
exclude: | |
- os: macOS-latest | |
solver: pardiso | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channels: conda-forge | |
python-version: ${{ matrix.python-version }} | |
- name: Install Base Env | |
run: | | |
conda info | |
conda list | |
conda config --show | |
conda install --quiet --yes pip numpy scipy pytest pytest-cov | |
- name: Install MKL solver interface | |
if: ${{ matrix.solver == 'pardiso' }} | |
run: | |
conda install --quiet --yes pydiso ${{ runner.os == 'windows' && '"libblas=*=*mkl"' || ''}} | |
- name: Install MUMPS solver interface | |
if: ${{ matrix.solver == 'mumps' }} | |
run: | |
conda install --quiet --yes -python-mumps | |
- name: Install Our Package | |
run: | | |
pip install -v -e . | |
conda list | |
- name: Run Tests | |
run: | | |
pytest --cov-config=.coveragerc --cov-report=xml --cov=pymatsolver -s -v | |
- name: Test Documentation | |
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.11') }} | |
run: | | |
pip install -r requirements_docs.txt | |
cd docs | |
make html | |
cd .. | |
- name: Upload coverage | |
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.11') }} | |
uses: codecov/codecov-action@v4 | |
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@v4 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
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 -c conda-forge pip numpy scipy pydiso | |
pip install -r requirements_docs.txt | |
- name: Install Our Package | |
run: | | |
pip install -v -e . | |
- name: Generate Source Distribution | |
run: | | |
python setup.py sdist | |
- name: Build Documentation | |
run: | | |
cd docs | |
make html | |
cd .. | |
- name: GitHub Pages | |
uses: crazy-max/[email protected] | |
with: | |
build_dir: docs/_build/html | |
jekyll: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: pypi-publish | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true |