ci(native-image): add x86_v2 arch to build matrix
Build & Test (NowChessSystems) TeamCity build failed

Adds x86-64-v2 microarchitecture as a second build target alongside
default. Images tagged with -x86_v2 suffix; GHA cache scoped per arch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Janis Eccarius
2026-05-30 15:03:43 +02:00
parent ae3ef766e8
commit a253fa78df
4 changed files with 24 additions and 37 deletions
+24 -11
View File
@@ -57,6 +57,13 @@ jobs:
- rule - rule
- store - store
- ws - ws
arch:
- name: default
march_flag: ""
tag_suffix: ""
- name: x86_v2
march_flag: "-march=x86-64-v2"
tag_suffix: "-x86_v2"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -66,12 +73,12 @@ jobs:
run: | run: |
if [ -f "modules/${{ matrix.module }}/versions.env" ]; then if [ -f "modules/${{ matrix.module }}/versions.env" ]; then
source modules/${{ matrix.module }}/versions.env source modules/${{ matrix.module }}/versions.env
VERSION="${MAJOR}.${MINOR}.${PATCH}" VERSION="${MAJOR}.${MINOR}.${PATCH}${{ matrix.arch.tag_suffix }}"
echo "[${{ matrix.module }}] Version: ${VERSION}" echo "[${{ matrix.module }}/${{ matrix.arch.name }}] Version: ${VERSION}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT" echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
else else
echo "[${{ matrix.module }}] No versions.env found — using 'latest'" echo "[${{ matrix.module }}/${{ matrix.arch.name }}] No versions.env found — using 'latest${{ matrix.arch.tag_suffix }}'"
echo "version=latest" >> "$GITHUB_OUTPUT" echo "version=latest${{ matrix.arch.tag_suffix }}" >> "$GITHUB_OUTPUT"
fi fi
- name: Check if image exists in GHCR - name: Check if image exists in GHCR
@@ -83,12 +90,12 @@ jobs:
VERSION="${{ steps.version.outputs.version }}" VERSION="${{ steps.version.outputs.version }}"
EXISTING_TAGS=$(gh api "orgs/now-chess/packages/container/${PACKAGE}/versions" \ EXISTING_TAGS=$(gh api "orgs/now-chess/packages/container/${PACKAGE}/versions" \
--jq '.[].metadata.container.tags[]' 2>/dev/null || echo "") --jq '.[].metadata.container.tags[]' 2>/dev/null || echo "")
echo "[${{ matrix.module }}] Existing tags: $(echo "${EXISTING_TAGS}" | tr '\n' ' ' | xargs)" echo "[${{ matrix.module }}/${{ matrix.arch.name }}] Existing tags: $(echo "${EXISTING_TAGS}" | tr '\n' ' ' | xargs)"
if echo "${EXISTING_TAGS}" | grep -qx "${VERSION}"; then if echo "${EXISTING_TAGS}" | grep -qx "${VERSION}"; then
echo "[${{ matrix.module }}] Image ${VERSION} already exists — skipping build" echo "[${{ matrix.module }}/${{ matrix.arch.name }}] Image ${VERSION} already exists — skipping build"
echo "exists=true" >> "$GITHUB_OUTPUT" echo "exists=true" >> "$GITHUB_OUTPUT"
else else
echo "[${{ matrix.module }}] Image ${VERSION} not found — will build" echo "[${{ matrix.module }}/${{ matrix.arch.name }}] Image ${VERSION} not found — will build"
echo "exists=false" >> "$GITHUB_OUTPUT" echo "exists=false" >> "$GITHUB_OUTPUT"
fi fi
@@ -112,7 +119,13 @@ jobs:
- name: Build native binary - name: Build native binary
if: steps.image-check.outputs.exists == 'false' if: steps.image-check.outputs.exists == 'false'
run: ./gradlew :modules:${{ matrix.module }}:build -x test -Dquarkus.native.enabled=true -Dquarkus.package.jar.enabled=false -Dquarkus.profile=deployed --no-daemon run: |
MARCH="${{ matrix.arch.march_flag }}"
MARCH_ARG=""
if [ -n "$MARCH" ]; then
MARCH_ARG="-Dquarkus.native.additional-build-args=$MARCH"
fi
./gradlew :modules:${{ matrix.module }}:build -x test -Dquarkus.native.enabled=true -Dquarkus.package.jar.enabled=false -Dquarkus.profile=deployed $MARCH_ARG --no-daemon
- name: Set up Docker Buildx - name: Set up Docker Buildx
if: steps.image-check.outputs.exists == 'false' if: steps.image-check.outputs.exists == 'false'
@@ -134,7 +147,7 @@ jobs:
images: ghcr.io/now-chess/now-chess-systems/${{ matrix.module }} images: ghcr.io/now-chess/now-chess-systems/${{ matrix.module }}
tags: | tags: |
type=raw,value=${{ steps.version.outputs.version }} type=raw,value=${{ steps.version.outputs.version }}
type=raw,value=latest type=raw,value=latest${{ matrix.arch.tag_suffix }}
- name: Build and push - name: Build and push
if: steps.image-check.outputs.exists == 'false' if: steps.image-check.outputs.exists == 'false'
@@ -145,5 +158,5 @@ jobs:
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.module }} cache-from: type=gha,scope=${{ matrix.module }}-${{ matrix.arch.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.module }} cache-to: type=gha,mode=max,scope=${{ matrix.module }}-${{ matrix.arch.name }}
-19
View File
@@ -5,25 +5,6 @@
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="ms-21" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/modules" />
<option value="$PROJECT_DIR$/modules/account" />
<option value="$PROJECT_DIR$/modules/api" />
<option value="$PROJECT_DIR$/modules/bot-platform" />
<option value="$PROJECT_DIR$/modules/coordinator" />
<option value="$PROJECT_DIR$/modules/core" />
<option value="$PROJECT_DIR$/modules/io" />
<option value="$PROJECT_DIR$/modules/json" />
<option value="$PROJECT_DIR$/modules/official-bots" />
<option value="$PROJECT_DIR$/modules/rule" />
<option value="$PROJECT_DIR$/modules/security" />
<option value="$PROJECT_DIR$/modules/store" />
<option value="$PROJECT_DIR$/modules/ws" />
</set>
</option>
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>
</component> </component>
-1
View File
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration"> <component name="FrameworkDetectionExcludesConfiguration">
Generated
-6
View File
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CommitMessageInspectionProfile">
<profile version="1.0">
<inspection_tool class="CommitFormat" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CommitNamingConvention" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
<component name="IssueNavigationConfiguration"> <component name="IssueNavigationConfiguration">
<option name="links"> <option name="links">
<list> <list>