Skip to content

tests

tests #267

Workflow file for this run

# Regular tests
#
# Use this to ensure your tests are passing on every push and PR (skipped on
# pushes which only affect documentation).
# There is also a cron job set to run weekly on the default branch, to check
# against dependency chain rot.
#
# You should make sure you run jobs on at least the *oldest* and the *newest*
# versions of python that your codebase is intended to support.
name: tests
on:
push:
pull_request:
schedule:
- cron: "0 0 * * 1"
branches: [ $default-branch ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: System information
run: python .github/workflows/system_info.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install --editable .[test]
- name: Debug environment
run: python -m pip freeze
- name: Test with pytest
run: |
python -m pip install pytest
python -m pip install pytest-cov
python -m pytest --cov=eodal --cov-report term --cov-report xml --cov-config .coveragerc --junitxml=testresults.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: unittests
env_vars: OS,PYTHON
name: Python ${{ matrix.python-version }} on ${{ runner.os }}
- name: Build HTML docs
run: |
python -m pip install --editable .[docs]
cd docs
make html
cd ..