Skip to content

I-ALiRT - MAG l1b equivalent (#1661) #25

I-ALiRT - MAG l1b equivalent (#1661)

I-ALiRT - MAG l1b equivalent (#1661) #25

Workflow file for this run

name: Tests
on:
push:
branches:
- dev
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12']
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
# We need the full history to generate the proper version number
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.8.0"
- name: Install dependencies and app
run: |
# Need to install extra plugins first
poetry self add "poetry-dynamic-versioning[plugin]"
poetry install --extras "test"
- name: Cache data directories
uses: actions/cache@v4
# We only download data on this runner, so only cache data from this run
# so we don't get an empty cache on other runners overriding that data
if: ${{ contains(matrix.os, 'ubuntu') && matrix.python-version == '3.10' }}
with:
path: |
**/data/
**/test_data/
key: cdf-data-${{ hashFiles('**/data/*', '**/test_data/*') }}
restore-keys: |
cdf-data-
- name: Testing
id: test
env:
USE_EXTERNAL_DATA: ${{ contains(matrix.os, 'ubuntu') && matrix.python-version == '3.10' }}
run: |
# Ignore the network marks from the remote test environment
if [ "$USE_EXTERNAL_DATA" = "true" ]; then
# Download external data before we run our tests so that
# we don't try to download them in parallel
poetry run python imap_processing/tests/conftest.py
poetry run pytest -n auto --color=yes --cov --cov-report=xml
else
poetry run pytest -n auto --color=yes --cov --cov-report=xml -m "not external_kernel and not external_test_data"
fi
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}