-
Notifications
You must be signed in to change notification settings - Fork 81
199 lines (156 loc) · 5.13 KB
/
Copy pathci-python.yml
File metadata and controls
199 lines (156 loc) · 5.13 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: "python / test e2e"
on:
pull_request:
branches:
- main
- release/*
paths:
- "packages/typespec-python/**"
- ".github/workflows/ci-python.yml"
- ".github/actions/setup-python/**"
merge_group:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: "Build & Regenerate"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-python
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm turbo run --filter "@azure-tools/typespec-python..." build
- name: Prepare Python environment
run: pnpm run prepare
working-directory: packages/typespec-python
- name: Regenerate
run: pnpm run regenerate
working-directory: packages/typespec-python
- name: Pre-build wheels
working-directory: packages/typespec-python
run: |
venv/bin/python tests/install_packages.py build azure tests
venv/bin/python tests/install_packages.py build unbranded tests
- name: Upload generated artifacts
uses: actions/upload-artifact@v4
with:
name: python-generated
path: |
packages/typespec-python/tests/generated
packages/typespec-python/tests/.wheels
packages/typespec-python/dist
core/packages/spector/dist
core/packages/http-specs/dist
packages/azure-http-specs/dist
retention-days: 1
test:
name: "Mock API Tests"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-python
- name: Install dependencies
run: pnpm install
- name: Build spector and specs
run: |
pnpm turbo run --filter "@typespec/spector..." build
pnpm --filter "@typespec/http-specs" exec tsc -p ./tsconfig.build.json
pnpm --filter "@azure-tools/azure-http-specs" exec tsc -p ./tsconfig.build.json
- name: Prepare Python environment
run: pnpm run prepare
working-directory: packages/typespec-python
- name: Download generated artifacts
uses: actions/download-artifact@v4
with:
name: python-generated
path: .
- name: Test
run: pnpm run test:python:e2e
working-directory: packages/typespec-python
typecheck:
name: "Type Checking"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-python
- name: Install dependencies
run: pnpm install --filter "@azure-tools/typespec-python..."
- name: Prepare Python environment
run: pnpm run prepare
working-directory: packages/typespec-python
- name: Download generated artifacts
uses: actions/download-artifact@v4
with:
name: python-generated
path: .
- name: Mypy & Pyright
run: pnpm run test:python:e2e --env mypy,pyright
working-directory: packages/typespec-python
lint:
name: "Lint & Format"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-python
- name: Install dependencies
run: pnpm install --filter "@azure-tools/typespec-python..."
- name: Prepare Python environment
run: pnpm run prepare
working-directory: packages/typespec-python
- name: Download generated artifacts
uses: actions/download-artifact@v4
with:
name: python-generated
path: .
- name: Pylint
run: pnpm run test:python:e2e --env lint
working-directory: packages/typespec-python
- name: Lint (extra)
run: pnpm run lint:extra
working-directory: packages/typespec-python
- name: Format check (extra)
run: pnpm run format:extra:check
working-directory: packages/typespec-python
docs:
name: "Docs Validation"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-python
- name: Install dependencies
run: pnpm install --filter "@azure-tools/typespec-python..."
- name: Prepare Python environment
run: pnpm run prepare
working-directory: packages/typespec-python
- name: Download generated artifacts
uses: actions/download-artifact@v4
with:
name: python-generated
path: .
- name: API View & Sphinx
run: pnpm run test:python:e2e --env apiview,sphinx
working-directory: packages/typespec-python