Skip to content

Commit

Permalink
Make deepsource step conditional on presence of secret
Browse files Browse the repository at this point in the history
  • Loading branch information
tovrstra committed Jun 14, 2024
1 parent 3b85b79 commit 7cc886b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ on:
tags-ignore:
# ... but not for tags (avoids duplicate work).
- '**'
pull_request_target:
# Run tests on pull requests, also from works, if given the allow-workflow label
types: [labeled, assigned]
pull_request:
# Run tests on pull requests
jobs:
tests:
strategy:
Expand All @@ -34,13 +33,20 @@ jobs:
run: pip install -e .[dev]
- name: Run fast tests with pytest
# If some are slow against expectations, the test will abort due to timeout.
run: pytest -vv -m "not slow" --cov=iodata --cov-report=xml --timeout=60
run: >-
pytest -vv
-m "not slow"
--timeout=60
--cov=iodata
--cov-report=xml
--cov-report=term-missing
- name: Upload coverage report to Deepsource
# See https://docs.deepsource.com/docs/analyzers-test-coverage#python
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
if: ${{ env.DEEPSOURCE_DSN != '' }}
run: |
curl https://deepsource.io/cli | sh
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
env:
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
- name: Run slow tests with pytest
run: pytest -vv -m slow

0 comments on commit 7cc886b

Please sign in to comment.