|
| 1 | +name: Daily CI Job |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 12 * * *' # Daily at midnight UTC |
| 6 | + |
| 7 | + # Can be triggered manually from the actions tab, if needed |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + test: |
| 12 | + name: test on Python ${{ matrix.python-version }} and pydantic ${{ matrix.pydantic-version }} |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] |
| 18 | + pydantic-version: ['main'] |
| 19 | + include: |
| 20 | + - python-version: '3.12' |
| 21 | + pydantic-version: '2.4' |
| 22 | + - python-version: '3.12' |
| 23 | + pydantic-version: '2.5' |
| 24 | + - python-version: '3.12' |
| 25 | + pydantic-version: '2.6' |
| 26 | + - python-version: '3.12' |
| 27 | + pydantic-version: '2.7' |
| 28 | + - python-version: '3.12' |
| 29 | + pydantic-version: '2.8' |
| 30 | + - python-version: '3.12' |
| 31 | + pydantic-version: '2.9' |
| 32 | + env: |
| 33 | + PYTHON: ${{ matrix.python-version }} |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Ensure requests to production domains fail |
| 38 | + if: runner.os == 'Linux' |
| 39 | + run: | |
| 40 | + echo "203.0.113.0 logfire.dev" | sudo tee -a /etc/hosts |
| 41 | + echo "203.0.113.0 logfire-api.pydantic.dev" | sudo tee -a /etc/hosts |
| 42 | + echo "203.0.113.0 logfire.pydantic.dev" | sudo tee -a /etc/hosts |
| 43 | +
|
| 44 | + - name: Install uv |
| 45 | + uses: astral-sh/setup-uv@v3 |
| 46 | + with: |
| 47 | + version: "0.4.30" |
| 48 | + enable-cache: true |
| 49 | + |
| 50 | + # upgrade deps to the latest versions for this daily test |
| 51 | + - run: uv sync --python ${{ matrix.python-version }} --upgrade |
| 52 | + |
| 53 | + - name: Install pydantic ${{ matrix.pydantic-version }} |
| 54 | + if: matrix.pydantic-version != 'main' |
| 55 | + # installs the most recent patch on the minor version's track, ex 2.6.0 -> 2.6.4 |
| 56 | + run: uv pip install 'pydantic==${{ matrix.pydantic-version }}.*' |
| 57 | + |
| 58 | + - run: uv run --no-sync pytest |
| 59 | + |
| 60 | + - name: Notify on failure |
| 61 | + if: failure() |
| 62 | + run: echo "Tests failed. TODO - send notification..." |
0 commit comments