-
Notifications
You must be signed in to change notification settings - Fork 81
77 lines (67 loc) · 2.5 KB
/
daily_deps_test.yml
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
name: Daily CI Job
on:
schedule:
- cron: '0 12 * * *' # Daily at midnight UTC
# Can be triggered manually from the actions tab, if needed
workflow_dispatch:
jobs:
test:
name: test on Python ${{ matrix.python-version }} and pydantic ${{ matrix.pydantic-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
pydantic-version: ['main']
include:
- python-version: '3.12'
pydantic-version: '2.4'
- python-version: '3.12'
pydantic-version: '2.5'
- python-version: '3.12'
pydantic-version: '2.6'
- python-version: '3.12'
pydantic-version: '2.7'
- python-version: '3.12'
pydantic-version: '2.8'
- python-version: '3.12'
pydantic-version: '2.9'
- python-version: '3.12'
pydantic-version: '2.10'
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Ensure requests to production domains fail
if: runner.os == 'Linux'
run: |
echo "203.0.113.0 logfire.dev" | sudo tee -a /etc/hosts
echo "203.0.113.0 logfire-api.pydantic.dev" | sudo tee -a /etc/hosts
echo "203.0.113.0 logfire.pydantic.dev" | sudo tee -a /etc/hosts
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.30"
enable-cache: true
# upgrade deps to the latest versions for this daily test
- run: uv sync --python ${{ matrix.python-version }} --upgrade
- name: Install pydantic ${{ matrix.pydantic-version }}
if: matrix.pydantic-version != 'main'
# installs the most recent patch on the minor version's track, ex 2.6.0 -> 2.6.4
run: uv pip install 'pydantic==${{ matrix.pydantic-version }}.*'
- run: uv run --no-sync pytest
notify-on-failure:
name: Notify maintainers on CI failure
runs-on: ubuntu-latest
needs: test
# only run if the test job failed
if: ${{ failure() }}
steps:
- name: Send slack message
uses: slackapi/slack-github-action@v2.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload: |
heading: Logfire daily CI deps test ${{github.repository}} failed!
body: See details at ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}