name: Tests on: push: branches: - dev pull_request: jobs: test: runs-on: ${{ matrix.os }} 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@v9 with: poetry-version: "2.3.4" - 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 -vvv -n auto --color=yes --cov --cov-report=xml --log-disable=root else poetry run pytest -vvv -n auto --color=yes --cov --cov-report=xml --log-disable=root -m "not external_kernel and not external_test_data" fi - name: Upload coverage reports to Codecov if: ${{ !cancelled() }} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }}