@@ -106,15 +106,15 @@ nodes:
106106 fi
107107
108108
109- export CC=gcc
110- export CXX=g++
109+ # On Linux, each arch has its own native runner, so skip non-native arch builds.
110+
111+ if [[ "$CURRENT_OS" == "linux" && "$ARCH" != "$CURRENT_ARCH" ]]; then
112+ echo "Skipping $CURRENT_OS-$ARCH build on $CURRENT_ARCH runner (native runner handles this)."
113+ exit 0
114+ fi
111115
112- # Cgo requires a cross-compiler that is not installed on GitHub runners
113- as of now.
114116
115- [[ "$CURRENT_OS" == "linux" && "$ARCH" == "arm64" ]] &&
116- CC=aarch64-linux-gnu-gcc &&
117- CXX=aarch64-linux-gnu-g++
117+ export CC=gcc export CXX=g++
118118
119119
120120 # Download P4 API SDK for the target platform
@@ -128,7 +128,7 @@ nodes:
128128 BUILD_FLAGS="-X actionforge/actrun-cli/build.Production=true -X actionforge/actrun-cli/build.License=$LICENSE -X actionforge/actrun-cli/build.Version=$GITHUB_REF_NAME"
129129
130130 # Run Go tests if target matches the current system
131- [[ "$CURRENT_OS " == "$CURRENT_OS" && "$ARCH" == "$CURRENT_ARCH" ]] && eval "go test -ldflags=\"$BUILD_FLAGS\" -o \"$OUTPUT_CLI\" ."
131+ [[ "$OS " == "$CURRENT_OS" && "$ARCH" == "$CURRENT_ARCH" ]] && eval "go test -ldflags=\"$BUILD_FLAGS\" -o \"$OUTPUT_CLI\" ."
132132
133133 # Determine P4 API paths and CGO flags per platform
134134 P4_INCLUDE="$(pwd)/p4api/include"
@@ -225,8 +225,6 @@ nodes:
225225 build_lib
226226
227227 run_e2e_tests
228-
229- exit 0
230228 env: []
231229 comment: build the cli and dll
232230 - id: length-v1-nectarine-squirrel-peacock
@@ -291,8 +289,13 @@ nodes:
291289 y: 3570
292290 inputs:
293291 script: |-
294- # check the build node script
295- sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
292+ # Install cross-compiler only if needed (x64 runner building for arm64).
293+ # With native arm64 runners, this is typically skipped.
294+ if [[ "$CURRENT_ARCH" != "arm64" ]]; then
295+ sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
296+ else
297+ echo "Running on native arm64 runner, no cross-compiler needed."
298+ fi
296299 comment: Install a GCC/G++ version capable of cross-compiling
297300 - id: switch-platform-v1-dog-snake-ivory
298301 type: core/switch-platform@v1
@@ -734,9 +737,14 @@ nodes:
734737 y: 1430
735738 inputs:
736739 script: |
737- echo "DEBUG publish: OS=$OS ARCH=$ARCH TARGET_TYPE=$TARGET_TYPE BUILD_DIR=$BUILD_DIR DIST_NEW=$DIST_NEW"
738740 mkdir -p "$DIST_NEW"
739741
742+ # On Linux, skip splitting for non-native arch (not built on this runner).
743+ if [[ "$OS" == "linux" && "$ARCH" != "$CURRENT_ARCH" ]]; then
744+ echo "Skipping split for $OS-$ARCH on $CURRENT_ARCH runner."
745+ exit 0
746+ fi
747+
740748
741749 if [[ "$TARGET_TYPE" == "cli" ]]; then
742750 if [[ "$OS" == "linux" || "$OS" == "macos" ]]; then
@@ -774,8 +782,12 @@ nodes:
774782 y: 1440
775783 inputs:
776784 script: |
777- echo "DEBUG package: OS=$OS ARCH=$ARCH TARGET_TYPE=$TARGET_TYPE DIST_NEW=$DIST_NEW"
778- ls -la "$DIST_NEW" || true
785+ # On Linux, skip extras for non-native arch (not built on this runner).
786+ if [[ "$OS" == "linux" && "$ARCH" != "$CURRENT_ARCH" ]]; then
787+ echo "Skipping extras for $OS-$ARCH on $CURRENT_ARCH runner."
788+ exit 0
789+ fi
790+
779791 if [[ "$TARGET_TYPE" == "py" ]]; then
780792 # Add Python libraries
781793 cp -r api/python/** $DIST_NEW
@@ -815,7 +827,7 @@ nodes:
815827 x: 8860
816828 y: 1060
817829 inputs:
818- if-no-files-found: error
830+ if-no-files-found: warn
819831 compression-level: '6'
820832 retention-days: '2'
821833 - id: string-fmt-v1-orange-mulberry-octopus
@@ -1557,6 +1569,12 @@ nodes:
15571569 dst:
15581570 node: for-each-loop-v1-octopus-jellyfish-rabbit
15591571 port: exec
1572+ - src:
1573+ node: concurrent-for-each-loop-v1-kiwano-dog-gray
1574+ port: exec-completed
1575+ dst:
1576+ node: group-outputs-v1-navy-durian-violet
1577+ port: exec-lime-banana-jackfruit
15601578 - src:
15611579 node: branch-v1-lime-peacock-kiwano
15621580 port: exec-otherwise
@@ -6048,14 +6066,27 @@ nodes:
60486066 VERSION="${GITHUB_REF_NAME}"
60496067
60506068
6069+ # Determine the native platform for this runner.
6070+
6071+ if [[ "$CURRENT_ARCH" == "arm64" ]]; then
6072+ PLATFORM="linux/arm64"
6073+ else
6074+ PLATFORM="linux/amd64"
6075+ fi
6076+
6077+
60516078 docker buildx create --use
60526079
6080+
6081+ # Build and push a single-arch image tagged with the arch suffix.
6082+ # The multi-arch manifest is created by a separate workflow job
6083+ # after both Linux runners complete.
6084+
60536085 docker buildx build \
6054- --platform linux/amd64,linux/arm64 \
6086+ --platform "$PLATFORM" \
60556087 --build-arg IMG_VERSION="$VERSION" \
60566088 --build-arg IMG_SOURCE="https://github.com/$GITHUB_REPOSITORY" \
6057- -t "$IMAGE:$VERSION" \
6058- -t "$IMAGE:latest" \
6089+ -t "$IMAGE:${VERSION}-${CURRENT_ARCH}" \
60596090 --push \
60606091 .
60616092 env: []
0 commit comments