ci(windows): changed CI matrix to have both mingw 32-bit and 64-bit builds for windows #538
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI - Build & Test | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master, dev] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
compiler: [clang, gcc, mingw] | |
exclude: | |
- os: ubuntu-latest | |
compiler: mingw | |
- os: macOS-latest | |
compiler: mingw | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
steps: | |
- uses: actions/checkout@v4 | |
# - name: Check (with ${{matrix.compiler}}, for ${{matrix.os}}) | |
# run: | | |
# printf "OS: $OS\n" | |
# printf "RUNNER_OS: $RUNNER_OS\n" | |
# printf "uname -s: $(uname -s)\n" | |
# env | |
# make clean-log | |
# make test-env-predef | |
# for i in `find log -name "predef_*.c"` ; do cat $i ; done | |
- name: Setup | |
if: ${{ (matrix.os != 'windows-latest') && (matrix.compiler != 'clang') }} | |
run: | | |
echo "CC=${{matrix.compiler}}" >> $GITHUB_ENV | |
- name: Setup (Windows, mingw 32-bit) | |
if: ${{ (matrix.os == 'windows-latest') && (matrix.compiler == 'gcc') }} | |
run: | | |
echo "CC=i686-w64-mingw32-gcc" >> $GITHUB_ENV | |
- name: Setup (Windows, mingw 64-bit) | |
if: ${{ (matrix.os == 'windows-latest') && (matrix.compiler == 'mingw') }} | |
run: | | |
echo "CC=x86_64-w64-mingw32-gcc" >> $GITHUB_ENV | |
# echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV | |
- name: Install/check prerequisite tools | |
run: | | |
make prereq-build | |
make prereq-tests | |
make prereq-dist | |
- name: Build library (with ${{matrix.compiler}}, for ${{matrix.os}}) | |
run: make BUILDMODE=release build CC=$CC | |
- name: Build test suite (with ${{matrix.compiler}}, for ${{matrix.os}}) | |
run: make BUILDMODE=release build-tests CC=$CC | |
- name: Run test suite (with ${{matrix.compiler}}, for ${{matrix.os}}) | |
run: make BUILDMODE=release test ARGS="-a" | |
- name: Create distributable package (for ${{matrix.os}}) | |
run: make BUILDMODE=release dist | |
- name: Upload build binary artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libccc-build_${{matrix.os}}_${{matrix.compiler}} | |
path: ./dist/*.zip | |
# - name: Release (with ${{matrix.compiler}}, for ${{matrix.os}}) | |
# run: make clean ; make build-release CC=${{matrix.compiler}} | |
# TODO: automate release tag for github ? |