-
Notifications
You must be signed in to change notification settings - Fork 256
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
118 lines (107 loc) · 3.81 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
118 lines (107 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
# Manual-only pipeline — equivalent to the old CircleCI "checks" workflow.
# Does NOT run on push or PR; launch via "Run pipeline" in Azure DevOps.
trigger: none
pr: none
pool:
vmImage: ubuntu-latest # swap for a self-hosted pool if hosted parallelism is unavailable
variables:
PYTHON_VERSION: '3.11'
UV_CACHE_DIR: $(Pipeline.Workspace)/.uv-cache # uv's global download/build cache
CACHE_KEY: 'uv | "$(Agent.OS)" | pyproject.toml'
jobs:
- job: build
displayName: Build (sync environment)
steps:
- script: |
echo "=== Before cleanup ==="
df -h /
# Remove pre-installed tool caches (biggest wins)
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /opt/hostedtoolcache/Java_*
sudo rm -rf /opt/hostedtoolcache/Ruby*
sudo rm -rf /opt/hostedtoolcache/go
sudo rm -rf /opt/hostedtoolcache/node
# Remove Android SDK, .NET SDKs, etc.
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/share/edge_driver
# Prune any stale Docker data
docker system prune -af --volumes
echo "=== After cleanup ==="
df -h /
displayName: Free up disk space
- task: Cache@2
inputs:
key: $(CACHE_KEY)
path: $(UV_CACHE_DIR)
- script: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Install uv
- script: uv sync --python $(PYTHON_VERSION)
displayName: Sync environment (uv)
- job: pip_check
displayName: Dependency check
steps:
- task: Cache@2
inputs:
key: $(CACHE_KEY)
path: $(UV_CACHE_DIR)
- script: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Install uv
- script: uv sync --python $(PYTHON_VERSION)
displayName: Sync environment (uv)
- script: uv pip check
displayName: Dependency check (uv pip check)
- job: test
displayName: Unit tests with Pytest
steps:
- task: Cache@2
inputs:
key: $(CACHE_KEY)
path: $(UV_CACHE_DIR)
- script: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Install uv
- script: uv sync --python $(PYTHON_VERSION) --extra test
displayName: Sync environment (uv)
- script: uv run pytest tests
displayName: Unit tests with Pytest
- job: lint
displayName: Linting with flake8
steps:
- task: Cache@2
inputs:
key: $(CACHE_KEY)
path: $(UV_CACHE_DIR)
- script: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Install uv
- script: uv sync --python $(PYTHON_VERSION) --extra lint
displayName: Sync environment (uv)
- script: uv run flake8 ampligraph --max-line-length 200 --ignore=W605,W503,E231
displayName: Linting with flake8
- job: docs
displayName: Making docs with Sphinx
steps:
- task: Cache@2
inputs:
key: $(CACHE_KEY)
path: $(UV_CACHE_DIR)
- script: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Install uv
- script: uv sync --python $(PYTHON_VERSION) --extra docs
displayName: Sync environment (uv)
- script: |
cd docs
uv run make clean autogen html
displayName: Making docs with Sphinx