forked from Arize-ai/openinference
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (91 loc) · 2.66 KB
/
Copy pathpython-cron.yaml
File metadata and controls
95 lines (91 loc) · 2.66 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
name: Python Canary Cron
on:
schedule:
- cron: "0 18 * * 1-5"
workflow_dispatch:
jobs:
find-tox-testenv:
name: Find tox testenv
runs-on: ubuntu-latest
outputs:
list: ${{ steps.testenv.outputs.list }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: python
- uses: astral-sh/setup-uv@v5
with:
version: 0.6.3
enable-cache: false
- name: Extract testenv into JSON list
run: >-
echo "list=$(uvx --with tox-uv tox -l
| egrep -e '-latest$'
| jq -R -s -c 'split("\n")[:-1]')"
>> $GITHUB_OUTPUT
working-directory: python
id: testenv
canary:
name: ${{ matrix.testenv }}
needs: find-tox-testenv
if: ${{ needs.find-tox-testenv.outputs.list != '[]' }}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
testenv: ${{ fromJSON(needs.find-tox-testenv.outputs.list) }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: python
- uses: astral-sh/setup-uv@v5
with:
version: 0.6.3
enable-cache: false
- run: uvx --with tox-uv tox r -e ${{ matrix.testenv }} -- -ra -x
working-directory: python
timeout-minutes: 10
- run: touch ${{ runner.temp }}/${{ matrix.testenv }}
if: failure()
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.testenv }}
path: ${{ runner.temp }}/${{ matrix.testenv }}
retention-days: 1
slack:
name: Slack notification
needs: canary
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- name: List failures as markdown
run: |
{
echo "list<<EOF"
find . -maxdepth 1 -type d ! -name '.' | sed 's|^\./||' | rev | sort -u | rev | nl -w2 -s'. '
echo "EOF"
} >> "$GITHUB_OUTPUT"
id: failures
- name: Create message text
if: ${{ steps.failures.outputs.list != '' }}
run: |
{
echo "text<<EOF"
echo "CI Failures for Python Packages:"
echo "${{ steps.failures.outputs.list }}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
id: message
- name: Send message to Slack
if: ${{ steps.failures.outputs.list != '' }}
uses: slackapi/slack-github-action@v1
with:
payload: |
{
"type": "mrkdwn",
"text": ${{ toJSON(steps.message.outputs.text) }}
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}