Skip to content

Move swift and dxpy into extras #79

Move swift and dxpy into extras

Move swift and dxpy into extras #79

Workflow file for this run

name: Python package
on: [pull_request]
env:
POETRY_VERSION: 1.0
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
POETRY_EXTRAS: ["-E swift", "-E dxpy", "", "-E swift -E dxpy"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-poetry-${{ matrix.python-version }}-
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry==${{env.POETRY_VERSION}}
poetry config --local virtualenvs.in-project true
- name: Install venv
run: |
export POETRY_EXTRAS="${{matrix.POETRY_EXTRAS}}"
make venv
- name: List versions - pip
run: |
mkdir htmlcov
poetry run pip list | tee htmlcov/pip-list.txt
- name: "List versions: pytest and python"
run: |
set -x
python --version | tee htmlcov/python.txt
poetry run pytest --version | tee htmlcov/pytest.txt
- name: Test with coverage
run: make unit-test
- name: Lint
run: make lint
- name: Doc build
run: make docs
- name: Build coverage report
if: always()
run: |
cp .coverage htmlcov/.coverage
poetry run python -m coverage html
- name: Create coverage report artifact
uses: actions/[email protected]
# TODO: make this only run if the build step at least ran
if: always()
with:
# Artifact name
name: html-coverage
# Directory containing files to upload
path: ./htmlcov