-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (97 loc) · 3.3 KB
/
Copy pathsetup.yml
File metadata and controls
119 lines (97 loc) · 3.3 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
# This workflow will install Python dependencies, run tests and lint
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: "CI"
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
testing:
name: "Testing / python ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: "Set up ${{ matrix.python-version }} on ${{ matrix.os }}"
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ matrix.python-version }}
- name: "Install just"
uses: extractions/setup-just@v2
- name: "Setup docker"
run: |
just build ${{ matrix.python-version }}
just up
- name: "Install uv"
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: "Install dependencies"
run: |
uv sync --group dev
- name: "Run linters"
run: |
just linter
- name: "Run static analysis"
run: |
just static-analysis
- name: "Build docs"
run: |
just docs-build --clean
- name: "Run tests"
run: |
just test-coverage-all
docker compose cp faststream_fastapi:/app/.coverage .coverage.${{ matrix.python-version }}
- name: "Store coverage file"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ github.event_name == 'pull_request' }}
with:
name: coverage-${{ matrix.python-version }}
path: .coverage.${{ matrix.python-version }}
if-no-files-found: error
include-hidden-files: true
coverage:
name: "Coverage"
runs-on: ubuntu-latest
needs: testing
permissions:
pull-requests: write
contents: write
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
id: download
with:
pattern: coverage-*
merge-multiple: true
- name: "Coverage comment"
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@5d8df5979747514c914e1c5a12335a7cf9a2745f # v4.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_COVERAGE_FILES: true
MINIMUM_GREEN: 90
- name: "Store Pull Request comment to be posted (for external pr)"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt