Skip to content

Commit ea3481f

Browse files
committed
ci: Adding mingw cross-compile test for makefiles. Cleaning up packaging and trying to get solaris going
Adding a mingw cross-compile test under ubuntu since that target should be supported. Cleaned up the packaging step to work more like it does in meson.yml Trying more things to get the solaris VM happy Signed-off-by: Tyler Erickson <tyler.erickson@seagate.com>
1 parent bf284a9 commit ea3481f

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

.github/workflows/c-cpp.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ jobs:
3636
release_extension: ".tar.xz",
3737
archive_command: "tar cvfJ"
3838
}
39+
- {
40+
name: "Ubuntu MinGW Cross-Compile",
41+
os: ubuntu-latest,
42+
mingw_cross: true,
43+
release_name: "win-x86_64-ubuntu-mingw",
44+
release_extension: ".zip",
45+
archive_command: "zip -r"
46+
}
3947
- {
4048
name: "MSYS2 MINGW64 GCC",
4149
os: windows-latest,
@@ -160,13 +168,25 @@ jobs:
160168
run: |
161169
echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
162170
171+
- name: Install MinGW cross-compiler
172+
if: matrix.config.mingw_cross == true
173+
run: |
174+
sudo apt-get update
175+
sudo apt-get install -y mingw-w64 zip
176+
163177
- name: Make buildjsonc.sh executable
164178
if: matrix.config.vm_actions != true && matrix.config.msys2_msystem == ''
165179
run: chmod +x Make/buildjsonc.sh
166180

167-
# Traditional make builds (Windows/Ubuntu)
181+
# Ubuntu MinGW cross-compile build
182+
- name: make (MinGW cross-compile)
183+
if: matrix.config.mingw_cross == true
184+
run: |
185+
make BUILD_TYPE=release CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++
186+
187+
# Traditional make builds (Windows/Ubuntu native)
168188
- name: make
169-
if: matrix.config.vm_actions != true && matrix.config.msys2_msystem == ''
189+
if: matrix.config.vm_actions != true && matrix.config.msys2_msystem == '' && matrix.config.mingw_cross != true
170190
run: |
171191
make BUILD_TYPE=release
172192
@@ -244,7 +264,7 @@ jobs:
244264
usesh: true
245265
prepare: |
246266
pkg update || true
247-
pkg install -y curl gmake bash
267+
pkg install -y curl gmake bash gcc
248268
/usr/sbin/dntpd -s
249269
250270
run: |
@@ -295,21 +315,22 @@ jobs:
295315
env:
296316
ARCHIVE_EXT: ${{ matrix.config.release_extension }}
297317
run: |
298-
mkdir -p build/package
299-
# Find the bin directory (target triplet varies by platform)
318+
# Find the bin directory and copy to DESTDIR for packaging
300319
BIN_DIR=$(find build -type d -name bin | head -n 1)
301320
if [ -z "$BIN_DIR" ]; then
302321
echo "Error: No bin directory found in build/"
303322
exit 1
304323
fi
305324
echo "Found executables in: $BIN_DIR"
306-
cd "${BIN_DIR}"
307-
${{ matrix.config.archive_command }} "../../build/package/${DESTDIR}${ARCHIVE_EXT}" .
308325
309-
- name: Uploading artifacts
310-
uses: actions/upload-artifact@v6.0.0
311-
with:
326+
# Copy binaries to a clean directory for packaging (matches meson approach)
327+
mkdir -p "build/${DESTDIR}"
328+
cp -r "${BIN_DIR}"/* "build/${DESTDIR}/"
329+
330+
# Create archive from build directory (simpler, matches meson.yml)
331+
cd build
332+
${{ matrix.config.archive_command }} "${DESTDIR}${ARCHIVE_EXT}" "${DESTDIR}"
312333
name: ${{ format('{0}', env.DESTDIR) }}
313-
path: ${{ format('./build/package/{0}{1}', env.DESTDIR, matrix.config.release_extension) }}
334+
path: ${{ format('./build/{0}{1}', env.DESTDIR, matrix.config.release_extension) }}
314335
315336
# Not packaging release from make since this comes from meson instead. This CI is meant to check that we preserve compatibility with older make systems as a backup only.

0 commit comments

Comments
 (0)