diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b68e169f..1723bbd9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,12 +1,21 @@ name: Full Tests on: - schedule: - - cron: "0 0 * * *" # daily pull_request: workflow_dispatch: + workflow_run: + workflows: [update-testing-data] + types: [completed] jobs: - run: + on-failure: + name: Notify on failure + runs-on: ${{ matrix.os }} + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + steps: + - run: | + echo 'The triggering workflow failed.' + 0 + on-success: name: Full tests on ${{ matrix.os }} with Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: @@ -29,18 +38,17 @@ jobs: pip install pytest-xdist git config --global user.email "CI@example.com" git config --global user.name "CI Almighty" - pip install wheel # needed for scanimage + pip install wheel==0.41.2 # needed for scanimage - name: Install roiextractors with minimal requirements run: pip install .[test] + - name: Run minimal tests run: pytest tests/test_internals -n auto --dist loadscope - name: Test full installation (-e needed for codecov report) run: pip install -e .[full] - - - name: Get ophys_testing_data current head hash id: ophys run: echo "::set-output name=HASH_OPHYS_DATASET::$(git ls-remote https://gin.g-node.org/CatalystNeuro/ophys_testing_data.git HEAD | cut -f1)" @@ -50,17 +58,6 @@ jobs: with: path: ./ophys_testing_data key: ophys-datasets-042023-${{ matrix.os }}-${{ steps.ophys.outputs.HASH_OPHYS_DATASET }} - - if: steps.cache-ophys-datasets.outputs.cache-hit == false - name: Install and configure AWS CLI - run: | - pip install awscli==1.25.27 - aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} - aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - if: steps.cache-ophys-datasets.outputs.cache-hit == false - name: Download data from S3 - run: aws s3 cp --recursive s3://${{ secrets.S3_GIN_BUCKET }}//ophys_testing_data ./ophys_testing_data - - - name: Run full pytest with coverage run: pytest -n auto --dist loadscope --cov=./ --cov-report xml:./codecov.xml diff --git a/.github/workflows/update-testing-data.yml b/.github/workflows/update-testing-data.yml index a2551302..d012a203 100644 --- a/.github/workflows/update-testing-data.yml +++ b/.github/workflows/update-testing-data.yml @@ -1,5 +1,7 @@ -name: Update testing data +name: update-testing-data on: + schedule: + - cron: "0 0 * * *" # daily workflow_dispatch: jobs: @@ -24,7 +26,7 @@ jobs: pip install -U pip git config --global user.email "CI@example.com" git config --global user.name "CI Almighty" - pip install wheel # needed for scanimage + pip install wheel==0.41.2 # needed for scanimage - name: Get ophys_testing_data current head hash id: ophys @@ -38,7 +40,7 @@ jobs: - if: steps.cache-ophys-datasets.outputs.cache-hit == false name: Install and configure AWS CLI run: | - pip install awscli==1.25.27 + pip install awscli==1.29.56 aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: steps.cache-ophys-datasets.outputs.cache-hit == false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4628d3b9..e3d93ccd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black exclude: ^docs/ diff --git a/README.md b/README.md index a8272d0e..31e54759 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![PyPI version](https://badge.fury.io/py/roiextractors.svg)](https://badge.fury.io/py/roiextractors) -![Full Tests](https://github.com/catalystneuro/roiextractors/actions/workflows/testing.yml/badge.svg) +![Full Tests](https://github.com/catalystneuro/roiextractors/actions/workflows/run-tests.yml/badge.svg) ![Auto-release](https://github.com/catalystneuro/roiextractors/actions/workflows/auto-publish.yml/badge.svg) [![codecov](https://codecov.io/github/catalystneuro/roiextractors/coverage.svg?branch=master)](https://codecov.io/github/catalystneuro/roiextractors?branch=master) [![documentation](https://readthedocs.org/projects/roiextractors/badge/?version=latest)](https://roiextractors.readthedocs.io/en/latest/)