Skip to content

cache CI environment #327

cache CI environment

cache CI environment #327

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: pysiaf CI
on: [ push, pull_request ]
jobs:
test:
name: test (${{ matrix.os }}, Python ${{ matrix.python }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python: [ "3.9", "3.10", "3.11" ]
include:
- os: macos-latest
python: "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/setup.*') }}
- run: python -m pip install . pytest pytest-xdist
- run: pip freeze
- run: pytest -n auto
test_with_coverage:
name: run tests with coverage
needs: [ test ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: test-coverage-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml', '**/setup.*') }}
- run: pip install -e ".[test]" pytest-xdist pytest-cov
- run: pip freeze
- run: pytest -n auto --cov-report=xml --cov-report=term-missing --cov=.