Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/load-shared-vars/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: "Load Shared Variables"
description: "Loads shared variables and sets them as environment variables and outputs"

outputs:
python-default:
description: "Default Python version for single-version jobs"
value: ${{ steps.load.outputs.python-default }}
python-test-matrix:
description: "Python version matrix for full tests"
value: ${{ steps.load.outputs.python-test-matrix }}
Expand All @@ -26,6 +29,7 @@ runs:
python_test_matrix='["3.11","3.12","3.13","3.14"]'
test_os_matrix='["ubuntu-latest","macos-latest","windows-latest"]'
echo "PYTHON_DEFAULT=$python_default" >> "$GITHUB_ENV"
echo "python-default=$python_default" >> "$GITHUB_OUTPUT"
echo "python-test-matrix=$python_test_matrix" >> "$GITHUB_OUTPUT"
echo "python-min-deps-matrix=$python_min_deps_matrix" >> "$GITHUB_OUTPUT"
echo "test-os-matrix=$test_os_matrix" >> "$GITHUB_OUTPUT"
11 changes: 7 additions & 4 deletions .github/test_code.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#!/bin/bash

# Script to run tests to account for wonkiness of periodic mac failures.
args="tests -s --cov dascore --cov-append --cov-report=xml"
args=(tests -m "not network" -s --cov dascore --cov-append --cov-report=xml)
if [[ "$1" == "network" ]]; then
args=(tests -m network -s --cov dascore --cov-append --cov-report=xml)
fi
if [[ "$1" == "doctest" ]]; then
args="dascore --doctest-modules"
args=(dascore --doctest-modules)
fi
if [[ "$1" == "profile" ]]; then
args="benchmarks --codspeed"
args=(benchmarks --codspeed)
fi

exit_code=0

python -m pytest $args || exit_code=$?
python -m pytest "${args[@]}" || exit_code=$?

# Check the exit code is related to sporadic failures on mac, see #312
if [ $exit_code -ne 132 ] && [ $exit_code -ne 0 ]; then
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
# Shared values live in .github/actions/load-shared-vars/action.yml
python-default: ${{ steps.load-vars.outputs.python-default }}
python-matrix: ${{ steps.load-vars.outputs.python-test-matrix }}
os-matrix: ${{ steps.load-vars.outputs.test-os-matrix }}
steps:
Expand Down Expand Up @@ -120,3 +121,49 @@ jobs:
if: steps.generate_qmd_tests.outcome == 'failure' || steps.run_test_suite.outcome == 'failure' || steps.run_docstrings.outcome == 'failure'
shell: bash
run: exit 1

network_tests:
needs: setup
timeout-minutes: 60
continue-on-error: true
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]

# Keep remote-IO coverage visible without blocking unrelated changes.
if: github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'no_ci')

env:
env_file: 'environment.yml'

steps:
- uses: actions/checkout@v4
with:
fetch-tags: 'true'
fetch-depth: '0'
persist-credentials: false

- uses: ./.github/actions/mamba-install-dascore
with:
python-version: ${{ needs.setup.outputs.python-default }}
cache-number: ${{ env.CACHE_NUMBER }}
prepare-test-data: "true"

- name: run network tests
shell: bash -el {0}
run: ./.github/test_code.sh network

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
files: ./coverage.xml
flags: network
name: PR_network_tests_${{ matrix.os }}
token: ${{ secrets.CODECOV_TOKEN }}

- name: summarize non-gating failure
if: failure()
shell: bash
run: echo "Network tests failed, but this report-only job does not block the workflow." >> "$GITHUB_STEP_SUMMARY"
5 changes: 5 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
flags:
unittests:
carryforward: false
network:
carryforward: true
Loading