Full test suite #294
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Full test suite | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
run_tests: | |
runs-on: ${{ matrix.os }} | |
if: | | |
!contains(github.event.head_commit.message, '+ONLYDOCS') && | |
!contains(github.event.head_commit.message, '+NOFULLTEST') | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11', '3.12'] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
label: linux-64 | |
prefix: /usr/share/miniconda3/envs/test | |
- os: macos-latest | |
label: osx-64 | |
prefix: /Users/runner/miniconda3/envs/test | |
- os: windows-latest | |
label: win-64 | |
prefix: C:\Miniconda3\envs\test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- uses: conda-incubator/setup-miniconda@v3.1.0 | |
with: | |
activate-environment: test${{ matrix.python-version }} | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ matrix.prefix }}${{ matrix.python-version }} | |
key: ${{ matrix.label }}-conda-py${{ matrix.python-version }}-${{ hashFiles('.github/environment.yml') }}-${{ steps.date.outputs.date }}-${{ env.CACHE_NUMBER }} | |
env: | |
# Increase this value to reset cache if etc/example-environment.yml has not changed | |
CACHE_NUMBER: 1 | |
id: cache | |
- name: Update environment | |
run: conda env update -n test${{ matrix.python-version }} -f .github/environment.yml | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: print package info | |
shell: bash -l {0} | |
run: | | |
conda info -a | |
conda list | |
- name: Install MSNoise | |
shell: bash -l {0} | |
run: | | |
pip install -e . | |
- name: Test suite | |
shell: bash -l {0} | |
run: | | |
pytest -s --cov msnoise msnoise/test/tests.py --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Test 3C data | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | |
shell: bash -l {0} | |
run: | | |
pytest -s --cov msnoise msnoise/test/tests-threecomponent.py --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |