Skip to content

Merge pull request #64 from lmmx/lmmx/vercel-fix-2 #136

Merge pull request #64 from lmmx/lmmx/vercel-fix-2

Merge pull request #64 from lmmx/lmmx/vercel-fix-2 #136

Workflow file for this run

---
name: CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
repository_dispatch:
types: rebuild
jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-20.04"
env:
USING_COVERAGE: '3.10'
TOX_PARALLEL_NO_SPINNER: 1
strategy:
matrix:
python-version: ["3.10", "3.11"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: "actions/checkout@v2"
- name: "Install miniconda"
run: |
if [[ ! -z $INSTALL_MINICONDA ]]; then source tools/github/install_miniconda.sh; fi
- name: "Setup miniconda"
uses: "conda-incubator/setup-miniconda@v2"
with:
auto-update-conda: true
python-version: "${{ matrix.python-version }}"
channels: "conda-forge,anaconda"
- name: "Install dependencies"
run: |
set -xe
which python
python -VV
python -m site
python -m pip install --upgrade pip setuptools pdm
pdm install -d
- name: "Run tox targets for ${{ matrix.python-version }}"
run: |
pdm run pytest --version
pdm run tox -v -p 2 # Only use 2 CPUs so coverage-report runs after pytest
- name: "Get coverage"
run: |
set -xe
python -m coverage combine
python -m coverage xml
if: "contains(env.USING_COVERAGE, matrix.python-version)"
- name: Upload coverage to Codecov
if: "contains(env.USING_COVERAGE, matrix.python-version)"
uses: "codecov/codecov-action@v1"
with:
fail_ci_if_error: true
package:
name: "Build & verify package"
runs-on: "ubuntu-20.04"
defaults:
run:
shell: bash -l {0}
steps:
- name: "Check out mvdef"
uses: "actions/checkout@v2"
- name: "Install miniconda"
run: |
if [[ ! -z $INSTALL_MINICONDA ]]; then source tools/github/install_miniconda.sh; fi
- name: "Setup miniconda"
uses: "conda-incubator/setup-miniconda@v2"
with:
auto-update-conda: true
python-version: "3.10"
channels: "conda-forge,anaconda"
- name: "Install build, and check-wheel-content"
run: "python -m pip install pdm check-wheel-contents"
- name: "Build package"
run: "pdm build"
- name: "List result"
run: "ls -l dist"
- name: "Check wheel contents"
run: "check-wheel-contents dist/*.whl"
install-dev:
strategy:
matrix:
os: ["ubuntu-20.04"]
name: "Verify dev env"
runs-on: "${{ matrix.os }}"
defaults:
run:
shell: bash -l {0}
steps:
- uses: "actions/checkout@v2"
- name: "Install miniconda"
run: |
if [[ ! -z $INSTALL_MINICONDA ]]; then source tools/github/install_miniconda.sh; fi
- name: "Setup miniconda"
uses: "conda-incubator/setup-miniconda@v2"
with:
auto-update-conda: true
python-version: "3.10"
channels: "conda-forge,anaconda"
- name: "Install in dev mode"
run: |
echo "CONDA=$CONDA"
echo "python=$(which python)"
echo "conda=$(which conda)"
python -m pip install -e .
- name: "Import package"
run: "python -c 'import mvdef; print(mvdef)'"