Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
gpustack-operator/.github/workflows/ci.yml at main · gpustack/gpustack-operator · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
gpustack
gpustack-operator
Repository navigation
Code
Issues
28
(28)
Pull requests
Actions
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
gpustack-operator
/
.github
/
workflows
/
ci.yml
Copy path
View runs
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
220 lines (213 loc) · 7.87 KB
main
Breadcrumbs
gpustack-operator
/
.github
/
workflows
/
ci.yml
Copy path
Top
File metadata and controls
Code
Blame
220 lines (213 loc) · 7.87 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#
This workflow runs for continuous integration (CI) of the project.
name
:
CI
permissions
:
actions
:
read
contents
:
read
pull-requests
:
read
defaults
:
run
:
shell
:
bash
on
:
workflow_dispatch
:
inputs
:
heavy
:
description
:
'
Build on the larger "-8x" runners: "auto" decides from the changed files, "true" forces them, "false" keeps the standard runners.
'
required
:
false
type
:
choice
options
:
-
"
auto
"
-
"
true
"
-
"
false
"
default
:
"
auto
"
push
:
branches
:
-
"
main
"
-
"
v*-dev
"
tags
:
-
"
v*
"
#
NB(thxCode): pack/ is deliberately absent. pack/gpustack-operator/ holds the Dockerfile
#
this workflow builds, so ignoring it meant a change there never built the image it
#
defines, and never refreshed the registry build cache either — leaving the next
#
unrelated commit to absorb a full rebuild of every vendor SDK stage.
paths-ignore
:
-
"
deploy/**
"
-
"
docs/**
"
-
"
**.md
"
-
"
**.mdx
"
-
"
**.png
"
-
"
**.jpg
"
-
"
**.jpeg
"
-
"
**.gif
"
-
"
**.webp
"
pull_request
:
branches
:
-
"
main
"
-
"
v*-dev
"
paths-ignore
:
-
"
deploy/**
"
-
"
docs/**
"
-
"
**.md
"
-
"
**.mdx
"
-
"
**.png
"
-
"
**.jpg
"
-
"
**.jpeg
"
-
"
**.gif
"
-
"
**.webp
"
jobs
:
expand-matrix
:
runs-on
:
ubuntu-24.04
outputs
:
matrix
:
${{ steps.expand-matrix.outputs.matrix }}
steps
:
-
name
:
Checkout
uses
:
actions/checkout@v4
with
:
fetch-depth
:
0
persist-credentials
:
false
-
name
:
Detect Heavy Changes
id
:
detect-heavy
env
:
EVENT_NAME
:
${{ github.event_name }}
PR_BASE_SHA
:
${{ github.event.pull_request.base.sha }}
PUSH_BEFORE_SHA
:
${{ github.event.before }}
HEAVY_INPUT
:
${{ github.event.inputs.heavy || 'auto' }}
run
:
|
#
# A change to the operator Dockerfile, go.sum, the vendor shim sources under
# csrc/, or this CI workflow either rebuilds the whole image (base image /
# dependency graph) or alters the build recipe, which needs a bigger runner.
# The shim sources count because each shim is compiled inside its vendor's own
# build stage, on top of that vendor's SDK image: touching them voids that
# stage's cache, so the SDK image behind it is pulled and unpacked in full
# rather than served from the registry cache — and the standard runner's disk
# is what runs out first. Detect it by diffing the event's changed files
# against its base, and when present mark the build "heavy" so the matrix
# targets the "-8x" runner variant.
#
# An explicit "heavy" input overrides that, because the detection can only see
# this repository: a vendor base image moving under a mutable tag voids the
# registry cache without changing a single file here, and then only the person
# dispatching the run knows the build is about to be a full one.
#
if [[ "${HEAVY_INPUT}" != "auto" ]]; then
echo "heavy=${HEAVY_INPUT}" >>"$GITHUB_OUTPUT"
echo "DEBUG: heavy=${HEAVY_INPUT} (forced by input)"
exit 0
fi
HEAVY="false"
BASE=""
case "${EVENT_NAME}" in
pull_request) BASE="${PR_BASE_SHA}" ;;
push) BASE="${PUSH_BEFORE_SHA}" ;;
esac
# Diff against the base when it is a known ancestor; otherwise (a branch's
# first push carries an all-zero before-sha, or workflow_dispatch has none)
# inspect the tip commit alone.
NULL_SHA="0000000000000000000000000000000000000000"
if [[ -n "${BASE}" && "${BASE}" != "${NULL_SHA}" ]] && git cat-file -e "${BASE}^{commit}" 2>/dev/null; then
CHANGED="$(git diff --name-only "${BASE}" HEAD)"
else
CHANGED="$(git show --name-only --format='' HEAD)"
fi
if grep -qxE 'pack/gpustack-operator/Dockerfile|go\.sum|csrc/.+|\.github/workflows/(ci|_image)\.yml' <<<"${CHANGED}"; then
HEAVY="true"
fi
echo "heavy=${HEAVY}" >>"$GITHUB_OUTPUT"
echo "DEBUG: CHANGED=${CHANGED}"
echo "DEBUG: heavy=${HEAVY}"
-
name
:
Set Matrix
id
:
expand-matrix
env
:
HEAVY
:
${{ steps.detect-heavy.outputs.heavy }}
run
:
|
# A heavy build targets the "-8x" runner variant (4x resources); a normal
# build keeps the default runners.
SUFFIX=""
if [[ "${HEAVY}" == "true" ]]; then
SUFFIX="-8x"
fi
cat <<EOF > matrix.json
[
{
"runner": "ubuntu-24.04${SUFFIX}",
"platform": "linux/amd64"
},
{
"runner": "ubuntu-24.04-arm${SUFFIX}",
"platform": "linux/arm64"
}
]
EOF
MATRIX="$(jq -cr . matrix.json)"
echo "matrix=${MATRIX}" >>"$GITHUB_OUTPUT"
echo "DEBUG: MATRIX=${MATRIX}"
image
:
needs
:
-
expand-matrix
uses
:
./.github/workflows/_image.yml
with
:
repository
:
gpustack-operator
matrix
:
${{ needs.expand-matrix.outputs.matrix }}
#
A pull request builds without pushing, so it also writes no registry cache.
push
:
${{ github.event_name != 'pull_request' }}
go-cache
:
true
tags
:
|
type=ref,event=pr
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/main' }}
type=sha,prefix=dev-,enable=${{ github.ref == 'refs/heads/main' }}
type=ref,event=branch,enable=${{ contains(github.ref, 'refs/heads/v') && endsWith(github.ref, '-dev') }}
type=sha,prefix={{branch}}-,enable=${{ contains(github.ref, 'refs/heads/v') && endsWith(github.ref, '-dev') }}
type=pep440,pattern={{raw}}
type=pep440,pattern=v{{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/') }}
flavor
:
|
latest=false
build-args
:
|
GPUSTACK_GIT_COMMIT=${{ github.sha }}
GPUSTACK_GIT_VERSION=${{ github.ref_type == 'tag' && github.ref_name || '' }}
secrets
:
dockerhub-password
:
${{ secrets.CI_DOCKERHUB_PASSWORD }}
release
:
if
:
${{ startsWith(github.ref, 'refs/tags/') }}
needs
:
-
image
timeout-minutes
:
30
runs-on
:
ubuntu-24.04
permissions
:
contents
:
write
steps
:
-
name
:
Checkout
uses
:
actions/checkout@v4
with
:
fetch-depth
:
0
fetch-tags
:
true
persist-credentials
:
false
-
name
:
Build Changelog
id
:
changelog
uses
:
mikepenz/release-changelog-builder-action@v5
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
with
:
mode
:
COMMIT
ignorePreReleases
:
"
true
"
configurationJson
:
|
{
"template": "#{{CHANGELOG}}",
"categories": [
{ "title": "## 🚀 Features", "labels": ["feat"] },
{ "title": "## 🐛 Fixes", "labels": ["fix"] },
{ "title": "## ♻️ Refactor", "labels": ["refactor"] },
{ "title": "## 📚 Docs", "labels": ["docs"] },
{ "title": "## 🔧 Maintenance", "labels": ["chore","ci","build","test","perf","style"] },
{ "title": "## Other", "labels": [] }
],
"label_extractor": [
{ "pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\-\\./]+\\))?(!)?: .+",
"on_property": "title", "target": "$1" }
]
}
-
name
:
Publish
uses
:
softprops/action-gh-release@v2
with
:
tag_name
:
"
${{ github.ref_name }}
"
prerelease
:
true
body
:
${{ steps.changelog.outputs.changelog }}
You can’t perform that action at this time.