forked from brutasse/graphite-api
-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (140 loc) · 4.5 KB
/
Copy pathtests.yml
File metadata and controls
165 lines (140 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
# Run monthly on the 1st at 00:00 UTC
- cron: '0 0 1 * *'
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.9"
toxenv: py39
- python-version: "3.10"
toxenv: py310
- python-version: "3.11"
toxenv: py311
- python-version: "3.12"
toxenv: py312
- python-version: "3.13"
toxenv: py313
- python-version: "3.14"
toxenv: py314
- python-version: "3.15-dev"
toxenv: py315
- python-version: "3.x"
toxenv: no-flask-caching
- python-version: "3.12"
toxenv: cairo
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install tox
run: pip install tox
- name: Run tests with tox
run: tox -e ${{ matrix.toxenv }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
cache: 'pip'
- name: Build release distributions
run: |
python -m pip install build
python -m build
- name: Upload distributions
uses: actions/upload-artifact@v6
with:
name: dist
path: dist/
docs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
cache: 'pip'
- name: Install documentation dependencies
run: |
python -m pip install -e ".[docs]"
- name: Build documentation
run: |
cd docs
make html
- name: Upload documentation
uses: actions/upload-artifact@v6
with:
name: docs
path: docs/_build/html/
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./docs/_build/html/
create-issue-on-failure:
runs-on: ubuntu-latest
needs: [test, build, docs]
if: always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
permissions:
issues: write
steps:
- name: Create issue on failure
uses: actions/github-script@v8
with:
script: |
const title = 'Scheduled Tests Failed';
const workflowUrl = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
const timestamp = new Date().toISOString();
const body = `The scheduled test run failed on ${timestamp}.
**Workflow Run:** ${workflowUrl}
Please investigate the failure and fix any issues.`;
const commentBody = `Another test failure occurred on ${timestamp}.
**Workflow Run:** ${workflowUrl}`;
// Check if there's already an open issue with the same title
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: ['automated-test-failure']
});
const existingIssue = issues.data.find(issue => issue.title === title);
if (existingIssue) {
// Add a comment to the existing issue
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: existingIssue.number,
body: commentBody
});
} else {
// Create a new issue
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: title,
body: body,
labels: ['automated-test-failure'],
assignees: ['Copilot']
});
}