Skip to content

Commit d460e8c

Browse files
authored
Ci improvements (#57)
* Add CODEOWNERS * Renovatebot PR aggregation * Scheduled tests
1 parent 7d6399f commit d460e8c

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @febus982

.github/workflows/python-tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ on:
88
branches: [ "main" ]
99
pull_request:
1010
branches: [ "main" ]
11+
# Run tests on Friday to check if tests pass with updated dependencies
12+
schedule:
13+
- cron: '0 0 * * 5'
1114
# Allows you to run this workflow manually from the Actions tab
1215
workflow_dispatch:
1316

1417
jobs:
1518
test:
1619
strategy:
20+
fail-fast: false
1721
matrix:
1822
version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1923
os: [ubuntu-latest]
@@ -31,5 +35,49 @@ jobs:
3135
poetry config virtualenvs.create false
3236
poetry install --no-root --with dev
3337
- name: Test with pytest
38+
id: citest
3439
run: |
3540
make ci-test
41+
42+
failure-notification:
43+
runs-on: ubuntu-latest
44+
needs: test
45+
if: failure() && github.event.schedule == '0 0 * * 5'
46+
permissions:
47+
issues: write
48+
steps:
49+
- uses: actions/checkout@v4
50+
- name: Create label if not exists
51+
run: |
52+
gh label create scheduled-failure --force --color B60205
53+
env:
54+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Opens an issue if not already existing and open
57+
run: |
58+
previous_issue_number=$(gh issue list \
59+
--label "$LABELS" \
60+
--json number \
61+
--jq '.[0].number')
62+
if [[ -n $previous_issue_number ]]; then
63+
gh issue edit "$previous_issue_number" --body "$BODY"
64+
else
65+
new_issue_url=$(gh issue create \
66+
--title "$TITLE" \
67+
--label "$LABELS" \
68+
--body "$BODY")
69+
if [[ $PINNED == true ]]; then
70+
gh issue pin "$new_issue_url"
71+
fi
72+
fi
73+
env:
74+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
GH_REPO: ${{ github.repository }}
76+
TITLE: Scheduled automated test failure
77+
LABELS: scheduled-failure
78+
BODY: |
79+
### Test suite failed during scheduled run
80+
81+
[Link to failing run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
82+
83+
PINNED: false

renovate.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,19 @@
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
44
"config:recommended"
5+
],
6+
"packageRules": [
7+
{
8+
"groupName": "all non-major dependencies",
9+
"groupSlug": "all-minor-patch",
10+
"matchPackagePatterns": [
11+
"*"
12+
],
13+
"excludePackageNames": ["python"],
14+
"matchUpdateTypes": [
15+
"minor",
16+
"patch"
17+
]
18+
}
519
]
620
}

0 commit comments

Comments
 (0)