Full spikeinterface tests codecov #279
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 spikeinterface tests codecov | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 12 * * *" # Daily at noon UTC | |
env: | |
KACHERY_CLOUD_CLIENT_ID: ${{ secrets.KACHERY_CLOUD_CLIENT_ID }} | |
KACHERY_CLOUD_PRIVATE_KEY: ${{ secrets.KACHERY_CLOUD_PRIVATE_KEY }} | |
jobs: | |
full-tests-with-codecov: | |
name: Codecov in Ubuntu | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# "macos-latest", "windows-latest" | |
os: ["ubuntu-latest", ] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Get current year-month | |
id: date | |
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT | |
- name: Restore cached virtual environment with dependencies | |
uses: actions/cache/restore@v3 | |
id: cache-venv | |
with: | |
path: ${{ github.workspace }}/test_env | |
key: ${{ runner.os }}-venv-${{ hashFiles('**/pyproject.toml') }}-${{ steps.date.outputs.date }} | |
- name: Get ephy_testing_data current head hash | |
# the key depends on the last comit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git | |
id: vars | |
run: | | |
echo "HASH_EPHY_DATASET=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT | |
- name: Restore cached gin data for extractors tests | |
uses: actions/cache/restore@v3 | |
id: cache-datasets | |
env: | |
# the key depends on the last comit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git | |
HASH_EPHY_DATASET: git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1 | |
with: | |
path: ~/spikeinterface_datasets | |
key: ${{ runner.os }}-datasets-${{ steps.vars.outputs.HASH_EPHY_DATASET }} | |
restore-keys: ${{ runner.os }}-datasets | |
- name: Install packages | |
uses: ./.github/actions/build-test-environment | |
- name: Shows installed packages by pip, git-annex and cached testing files | |
uses: ./.github/actions/show-test-environment | |
- name: run tests | |
run: | | |
source ${{ github.workspace }}/test_env/bin/activate | |
pytest -m "not sorters_external" --cov=./ --cov-report xml:./coverage.xml -vv -ra --durations=0 | tee report_full.txt; test ${PIPESTATUS[0]} -eq 0 || exit 1 | |
echo "# Timing profile of full tests" >> $GITHUB_STEP_SUMMARY | |
python ./.github/build_job_summary.py report_full.txt >> $GITHUB_STEP_SUMMARY | |
cat $GITHUB_STEP_SUMMARY | |
rm report_full.txt | |
- uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
file: ./coverage.xml | |
flags: unittests |