forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (113 loc) · 3.81 KB
/
azure-sdk-tools.yml
File metadata and controls
135 lines (113 loc) · 3.81 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
name: Test Azure SDK Tools
on:
workflow_dispatch:
pull_request:
branches: [ main ]
paths:
- "eng/tools/azure-sdk-tools/**"
- ".github/workflows/azure-sdk-tools.yml"
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: 3.13
- name: Install azure-sdk-tools
run: |
python -m pip install -e eng/tools/azure-sdk-tools[ghtools,conda]
python -m pip freeze
shell: bash
- name: Run tests
run: |
pytest ./tests
shell: bash
working-directory: eng/tools/azure-sdk-tools
static-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: 3.13
- name: Install azure-sdk-tools
run: |
python -m pip install -e eng/tools/azure-sdk-tools[ghtools,conda]
python -m pip install black==24.4.0
python -m pip freeze
shell: bash
- name: Run black
run: |
black --check --config eng/black-pyproject.toml eng/tools/azure-sdk-tools --exclude 'templates'
shell: bash
verify-azpysdk-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: 3.13
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
shell: bash
- name: Install azure-sdk-tools on in global uv, discover azpysdk checks
run: |
uv pip install --system eng/tools/azure-sdk-tools[ghtools,conda,systemperf]
# Discover available azpysdk commands from the {command1,command2,...} line in help output
CHECKS=$(azpysdk -h 2>&1 | \
grep -oP '\{[^}]+\}' | \
tail -1 | \
tr -d '{}' | \
tr ',' '\n' | \
grep -v '^next-' | \
sort | \
paste -sd,)
if [ -z "$CHECKS" ]; then
echo "No azpysdk check modules discovered from azpysdk -h" >&2
exit 1
fi
echo "Discovered azpysdk checks: $CHECKS"
echo "AZPYSDK_CHECKS=$CHECKS" >> "$GITHUB_ENV"
shell: bash
- name: Run all discovered checks against azure-template using uv as package manager
run: |
sdk_build azure-template -d $(pwd)/wheels --build_id 20250101.1
python eng/scripts/dispatch_checks.py --checks "$AZPYSDK_CHECKS" --wheel_dir $(pwd)/wheels azure-template
shell: bash
env:
TOX_PIP_IMPL: "uv"
- name: Install azure-sdk-tools on global pip env
run: |
python -m pip install -e eng/tools/azure-sdk-tools[ghtools,conda]
shell: bash
- name: Run all discovered checks against azure-template using pip as package manager
run: |
python eng/scripts/dispatch_checks.py --checks "$AZPYSDK_CHECKS" --wheel_dir $(pwd)/wheels azure-template
shell: bash
env:
TOX_PIP_IMPL: "pip"
dev-setup-and-import:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: 3.13
- name: Run dev_setup to install specified packages
run: |
python scripts/dev_setup.py --packageList azure-storage-blob,azure-appconfiguration
shell: bash
- name: Validate imports
run: |
python - <<'PY'
from azure.storage.blob import *
from azure.appconfiguration import *
print("Successful Imports")
PY
shell: bash