Skip to content

Commit

Permalink
Merge pull request #33 from agriyakhetarpal/feat/open-report-on-failure
Browse files Browse the repository at this point in the history
Generate a test report and open issues if tests fail
  • Loading branch information
Carreau authored Oct 9, 2024
2 parents f6f12c7 + f7ed189 commit 646f8d9
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,30 @@ on: # yamllint disable-line rule:truthy
branches: ["main"]
pull_request:
branches: ["main"]
# Run at 04:00 UTC every Monday
schedule:
- cron: "0 4 * * 1"

permissions:
contents: read

jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: |
pip install pip --upgrade
pip install -ve '.[tests]'
pip install mypy sphinx
- run:
mypy

pytest:
continue-on-error: true
needs: [style]
runs-on: ${{ matrix.os }}
defaults:
run:
Expand All @@ -31,7 +48,23 @@ jobs:
pip install pip --upgrade
pip install -ve '.[tests]'
pip install mypy sphinx
- run:
pytest tests
- run:
mypy
pip install pytest-reportlog
- name: Test
id: pytest
run:
pytest tests --report-log pytest-log.jsonl

- run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV

- uses: xarray-contrib/[email protected]
if: |
failure()
&& steps.pytest.outcome == 'failure'
&& github.repository == 'Quansight-Labs/intersphinx_registry'
&& github.event_name == 'schedule'
with:
log-path: pytest-log.jsonl
issue-title: ⚠️ CI failure at ${{ env.NOW }} ⚠️
# issue-label: 'bug'

0 comments on commit 646f8d9

Please sign in to comment.