Skip to content

Update coverage settings #58

Update coverage settings

Update coverage settings #58

Workflow file for this run

name: Coord CI
on:
push:
branches:
- main
- runci
- releases/*
pull_request:
branches:
- main
- releases/*
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# First all python versions in basic linux
os: [ ubuntu-latest ]
py: [ 3.7, 3.8, 3.9, "3.10", 3.11, 3.12 ]
# Add some other particular combinations to test
include:
# One in MacOS
- os: macos-latest
py: 3.11
# Check one on Windows
- os: windows-latest
py: 3.11
steps:
- uses: actions/checkout@v4
with:
# Helpful for a reliable codecov upload.
fetch-depth: 0
- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.py }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.py }}-pip-
${{ runner.os }}-
- name: Install basic dependencies
run: |
python -m pip install -U pip
# Check what is already installed.
pip list
# Update setuptools
pip install -U setuptools
# Do this first to clarify potential conflicts
pip install -U numpy
# Standard dependencies
pip install -U -r requirements.txt
# Extra packages needed for testing
pip install -U codecov coverage pytest astropy
- name: List all installed packages for reference
run: pip list
- name: Build
run: pip install -vvv .
- name: Run unit tests
run: |
cd tests
coverage run -m pytest -v
coverage combine || true
coverage report
coverage xml
cd .. # N.B. This seems to happen automatically if omitted.
# Less confusing to include it explicitly.
- name: Upload coverage to codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: tests/coverage.xml
fail_ci_if_error: false
verbose: true