mirror of
https://github.com/fastapi/fastapi.git
synced 2026-09-14 13:36:21 +08:00
👷 Run tests only on relevant code changes (not on docs) (#14813)
This commit is contained in:
committed by
GitHub
parent
eacbce24c9
commit
7621a3aa4b
@@ -16,7 +16,35 @@ env:
|
|||||||
UV_NO_SYNC: true
|
UV_NO_SYNC: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
changes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Required permissions
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
# Set job outputs to values from filter step
|
||||||
|
outputs:
|
||||||
|
src: ${{ steps.filter.outputs.src }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
# For pull requests it's not necessary to checkout the code but for the main branch it is
|
||||||
|
- uses: dorny/paths-filter@v3
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
src:
|
||||||
|
- .github/workflows/test.yml
|
||||||
|
- docs_src/**
|
||||||
|
- fastapi/**
|
||||||
|
- scripts/**
|
||||||
|
- tests/**
|
||||||
|
- .python-version
|
||||||
|
- pyproject.toml
|
||||||
|
- uv.lock
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
needs:
|
||||||
|
- changes
|
||||||
|
if: needs.changes.outputs.src == 'true'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ windows-latest, macos-latest ]
|
os: [ windows-latest, macos-latest ]
|
||||||
@@ -91,7 +119,8 @@ jobs:
|
|||||||
include-hidden-files: true
|
include-hidden-files: true
|
||||||
|
|
||||||
coverage-combine:
|
coverage-combine:
|
||||||
needs: [test]
|
needs:
|
||||||
|
- test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
@@ -143,3 +172,4 @@ jobs:
|
|||||||
uses: re-actors/alls-green@release/v1
|
uses: re-actors/alls-green@release/v1
|
||||||
with:
|
with:
|
||||||
jobs: ${{ toJSON(needs) }}
|
jobs: ${{ toJSON(needs) }}
|
||||||
|
allowed-skips: coverage-combine,test
|
||||||
|
|||||||
Reference in New Issue
Block a user