Repository navigation
147 lines (143 loc) · 5.23 KB
/
Copy pathci.yml
File metadata and controls
147 lines (143 loc) · 5.23 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
---
name: Run CI Tests
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
# If another push to the same PR or branch happens while this workflow is still running,
# cancel the earlier run in favor of the next run.
#
# There's no point in testing an outdated version of the code. GitHub only allows
# a limited number of job runners to be active at the same time, so it's better to cancel
# pointless jobs early so that more useful jobs can run sooner.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
# Only test on the min and max supported Python versions.
# It's extremely unlikely that there's a lint issue on any version in between
# that doesn't show up on the min or max versions.
#
# GitHub rate-limits how many jobs can be running at any one time.
# Starting new jobs is also relatively slow,
# so linting on fewer versions makes CI faster.
python-version:
- "3.13"
uses:
./.github/workflows/_test.yml
with:
working-directory: "."
python-version: ${{ matrix.python-version }}
lint:
strategy:
matrix:
# Only lint on the min and max supported Python versions.
# It's extremely unlikely that there's a lint issue on any version in between
# that doesn't show up on the min or max versions.
#
# GitHub rate-limits how many jobs can be running at any one time.
# Starting new jobs is also relatively slow,
# so linting on fewer versions makes CI faster.
python-version:
- "3.13"
uses:
./.github/workflows/_lint.yml
with:
working-directory: "."
python-version: ${{ matrix.python-version }}
links:
strategy:
matrix:
# Only test docs on latest stable Python version since documentation
# build process doesn't typically vary between Python versions
python-version:
- "3.13"
uses:
./.github/workflows/_check-links.yml
with:
python-version: ${{ matrix.python-version }}
check-merge-conflicts:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Check for unresolved merge conflict markers
run: |
set -euo pipefail
if matches=$(git grep -nI -E '^<<<<<<<|^>>>>>>>|^=======$' -- . 2>/dev/null); then
echo "$matches"
echo ""
echo "❌ Unresolved merge conflict markers found."
echo "Remove all <<<<<<<, =======, and >>>>>>> lines and finish resolving conflicts."
exit 1
fi
echo "✅ No unresolved merge conflict markers found."
check-cross-refs:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- uses: "./.github/actions/uv_setup"
with:
python-version: "3.13"
- run: uv sync --group test
- run: make check-cross-refs
check-generated-files:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Skip check for automated updates
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
# Skip validation for automated package download updates
if [[ "${{ github.actor }}" == "github-actions[bot]" && "$PR_TITLE" == *"update package download counts"* ]]; then
echo "✅ Skipping check for automated package download update"
exit 0
fi
# Skip validation if PR has bypass-auto-check label
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'bypass-auto-check') }}" == "true" ]]; then
echo "✅ Skipping check due to bypass-auto-check label"
exit 0
fi
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv sync --group test
- name: Regenerate overview.mdx
run: uv run python pipeline/tools/partner_pkg_table.py
- name: Check for manual changes to generated files
run: |
if ! git diff --exit-code src/oss/python/integrations/providers/overview.mdx; then
echo "❌ Manual changes detected to src/oss/python/integrations/providers/overview.mdx"
echo "This file is auto-generated by pipeline/tools/partner_pkg_table.py"
echo "Please do not manually edit this file. If you need to make changes:"
echo "1. Update the generation script at pipeline/tools/partner_pkg_table.py"
echo "2. Or update the package metadata in packages.yml"
echo "3. Then run: uv run python pipeline/tools/partner_pkg_table.py"
exit 1
else
echo "✅ No manual changes detected to generated files"
fi