SDL: ci: test clang+MinGW on CI

From 69df26a0d40711704d715207d02339fec09b7e0f Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Wed, 15 Jun 2022 03:51:46 +0200
Subject: [PATCH] ci: test clang+MinGW on CI

---
 .github/workflows/main.yml | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 1837433a4ac..ff229664253 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -15,12 +15,12 @@ jobs:
       fail-fast: false
       matrix:
         platform:
-        - { name: Windows (mingw32),      os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
-        - { name: Windows (mingw64),      os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
-        - { name: Linux (CMake),          os: ubuntu-20.04,   shell: sh,    flags: true }
-        - { name: Linux (autotools),      os: ubuntu-20.04,   shell: sh,    autotools: true }
-        - { name: MacOS (CMake),          os: macos-latest,   shell: sh }
-        - { name: MacOS (autotools),      os: macos-latest,   shell: sh,    autotools: true }
+        - { name: Windows (mingw32),        os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686, cc: gcc }
+        - { name: Windows (mingw64+clang),  os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64, cc: clang }
+        - { name: Linux (CMake),            os: ubuntu-20.04,   shell: sh,    flags: true }
+        - { name: Linux (autotools),        os: ubuntu-20.04,   shell: sh,    autotools: true }
+        - { name: MacOS (CMake),            os: macos-latest,   shell: sh }
+        - { name: MacOS (autotools),        os: macos-latest,   shell: sh,    autotools: true }
 
     steps:
     - name: Set up MSYS2
@@ -29,10 +29,21 @@ jobs:
       with:
         msystem: ${{ matrix.platform.msystem }}
         install: >-
-          ${{ matrix.platform.msys-env }}-gcc
+          ${{ matrix.platform.msys-env }}-${{ matrix.platform.cc }}
           ${{ matrix.platform.msys-env }}-cmake
           ${{ matrix.platform.msys-env }}-ninja
           ${{ matrix.platform.msys-env }}-pkg-config
+    - name: Configure MSYS2 compiler
+      if: matrix.platform.shell == 'msys2 {0}'
+      run: |
+        if test x${{ matrix.platform.cc}} == xgcc; then
+          echo "CC=gcc" >> $GITHUB_ENV
+          echo "CXX=g++" >> $GITHUB_ENV
+        fi
+        if test x${{ matrix.platform.cc}} == xclang; then
+          echo "CC=clang" >> $GITHUB_ENV
+          echo "CXX=clang++" >> $GITHUB_ENV
+        fi
 
     - name: Setup Linux dependencies
       if: runner.os == 'Linux'