8
8
branches :
9
9
- " main"
10
10
11
+ env :
12
+ POETRY_CACHE_DIR : /tmp/pypoetry-cache
13
+ POETRY_VENV_IN_PROJECT : false
14
+ POETRY_INSTALLER_MODERN_INSTALLATION : false
15
+ PIP_NO_CACHE_DIR : 1
16
+
11
17
jobs :
12
18
lint-pr :
13
19
name : Lint PR
@@ -28,11 +34,17 @@ jobs:
28
34
steps :
29
35
- name : Free up disk space
30
36
run : |
37
+ # Remove unnecessary software and cached packages
31
38
sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' azure-cli google-cloud-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri || true
32
39
sudo apt-get autoremove -y
33
40
sudo apt-get clean
34
- # Remove Docker images
35
- docker rmi $(docker images -aq) || true
41
+ # Remove Docker images and containers
42
+ docker system prune -af || true
43
+ # Remove additional system files
44
+ sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL || true
45
+ sudo rm -rf /imagegeneration || true
46
+ # Clear APT cache completely
47
+ sudo rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* || true
36
48
# Show available space
37
49
df -h
38
50
- uses : actions/checkout@v4
@@ -46,13 +58,20 @@ jobs:
46
58
python-version : 3.11
47
59
- name : Install Poetry
48
60
uses : snok/install-poetry@v1
61
+ with :
62
+ version : latest
63
+ virtualenvs-create : true
64
+ virtualenvs-in-project : false
65
+ virtualenvs-path : ~/.cache/pypoetry/virtualenvs
49
66
50
67
- uses : actions/setup-node@v4
51
68
with :
52
69
node-version : 18
53
70
54
71
- uses : nrwl/nx-set-shas@v4
55
- - run : npm ci
72
+ - run : npm ci --cache ~/.npm --prefer-offline
73
+ - name : Clean npm cache
74
+ run : npm cache clean --force || true
56
75
- run : npx nx affected -t install --with dev
57
76
- run : npx nx affected -t lint --parallel=3
58
77
@@ -66,11 +85,17 @@ jobs:
66
85
steps :
67
86
- name : Free up disk space
68
87
run : |
88
+ # Remove unnecessary software and cached packages
69
89
sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' azure-cli google-cloud-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri || true
70
90
sudo apt-get autoremove -y
71
91
sudo apt-get clean
72
- # Remove Docker images
73
- docker rmi $(docker images -aq) || true
92
+ # Remove Docker images and containers
93
+ docker system prune -af || true
94
+ # Remove additional system files
95
+ sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL || true
96
+ sudo rm -rf /imagegeneration || true
97
+ # Clear APT cache completely
98
+ sudo rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* || true
74
99
# Show available space
75
100
df -h
76
101
- uses : actions/checkout@v4
@@ -83,20 +108,33 @@ jobs:
83
108
python-version : ${{ matrix.python-version }}
84
109
- name : Install Poetry
85
110
uses : snok/install-poetry@v1
111
+ with :
112
+ version : latest
113
+ virtualenvs-create : true
114
+ virtualenvs-in-project : false
115
+ virtualenvs-path : ~/.cache/pypoetry/virtualenvs
86
116
87
117
- uses : actions/setup-node@v4
88
118
with :
89
119
node-version : 18
90
120
91
121
- uses : nrwl/nx-set-shas@v4
92
122
93
- - run : npm ci
123
+ - run : npm ci --cache ~/.npm --prefer-offline
124
+ - name : Clean npm cache
125
+ run : npm cache clean --force || true
94
126
95
127
- name : Install
96
- run : npx nx affected -t install --with dev --parallel=3
128
+ run : npx nx affected -t install --with dev --parallel=2
129
+
97
130
98
131
- name : Build
99
- run : npx nx affected -t build-release --parallel=3
132
+ run : npx nx affected -t build-release --parallel=2
133
+
134
+ - name : Clean build artifacts to save space
135
+ run : |
136
+ find packages -name "dist" -type d -exec rm -rf {} + || true
137
+ find packages -name "*.egg-info" -type d -exec rm -rf {} + || true
100
138
101
139
test-packages :
102
140
name : Test Packages
@@ -111,11 +149,17 @@ jobs:
111
149
steps :
112
150
- name : Free up disk space
113
151
run : |
152
+ # Remove unnecessary software and cached packages
114
153
sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' azure-cli google-cloud-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri || true
115
154
sudo apt-get autoremove -y
116
155
sudo apt-get clean
117
- # Remove Docker images
118
- docker rmi $(docker images -aq) || true
156
+ # Remove Docker images and containers
157
+ docker system prune -af || true
158
+ # Remove additional system files
159
+ sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL || true
160
+ sudo rm -rf /imagegeneration || true
161
+ # Clear APT cache completely
162
+ sudo rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* || true
119
163
# Show available space
120
164
df -h
121
165
- uses : actions/checkout@v4
@@ -130,19 +174,33 @@ jobs:
130
174
131
175
- name : Install Poetry
132
176
uses : snok/install-poetry@v1
177
+ with :
178
+ version : latest
179
+ virtualenvs-create : true
180
+ virtualenvs-in-project : false
181
+ virtualenvs-path : ~/.cache/pypoetry/virtualenvs
133
182
134
183
- uses : actions/setup-node@v4
135
184
with :
136
185
node-version : 18
137
186
138
187
- uses : nrwl/nx-set-shas@v4
139
188
140
- - run : npm ci
189
+ - run : npm ci --cache ~/.npm --prefer-offline
190
+ - name : Clean npm cache
191
+ run : npm cache clean --force || true
141
192
142
193
- name : Install
143
- run : npx nx affected -t install --exclude='sample-app' --with dev --parallel=3
194
+ run : npx nx affected -t install --exclude='sample-app' --with dev --parallel=2
195
+
144
196
145
197
- name : Test
146
198
env :
147
199
HAYSTACK_TELEMETRY_ENABLED : False
148
- run : npx nx affected -t test --exclude='sample-app' --exclude='opentelemetry-instrumentation-haystack' --parallel=3
200
+ run : npx nx affected -t test --exclude='sample-app' --exclude='opentelemetry-instrumentation-haystack' --parallel=2
201
+
202
+ - name : Clean test artifacts to save space
203
+ run : |
204
+ find packages -name ".pytest_cache" -type d -exec rm -rf {} + || true
205
+ find packages -name "__pycache__" -type d -exec rm -rf {} + || true
206
+ find packages -name "*.pyc" -delete || true
0 commit comments