Skip to content

Commit

Permalink
[CI] added MinGW guard to the build and configuration step.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheVice committed Jan 31, 2024
1 parent 005028b commit 2dc5acb
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,39 @@ jobs:
- name: Checkout third-party libraries
run: git checkout origin/${{ matrix.os }} -- .

- name: Create project files
run: >-
cmake
${{ env.CMAKE_TARGET_PLATFORM }}
${{ env.CMAKE_GENERATOR }}
${{ env.CMAKE_BUILD_TYPE }}
-S ${{ github.workspace }}
-B ${{ env.CMAKE_BUILD_DIR }}
-DLIBRARY_BINARY_DIR=${{ env.LIBRARY_BINARY_DIR }}
-DPROGRAM_VERSION="${{ github.event.repository.updated_at }}"
# - name: Create project files
# run: >-
# cmake
# ${{ env.CMAKE_TARGET_PLATFORM }}
# ${{ env.CMAKE_GENERATOR }}
# ${{ env.CMAKE_BUILD_TYPE }}
# -S ${{ github.workspace }}
# -B ${{ env.CMAKE_BUILD_DIR }}
# -DLIBRARY_BINARY_DIR=${{ env.LIBRARY_BINARY_DIR }}
# -DPROGRAM_VERSION="${{ github.event.repository.updated_at }}"

- name: Create project files (MinGW)
if: ${{ 'mingw' == matrix.compiler }}
run: |
$Env:PATH="C:\mingw64\bin;$Env:SystemRoot\system32;$Env:SystemRoot;$Env:SystemRoot\system32\Wbem;$Env:SystemRoot\system32\WindowsPowerShell\v1.0\;$Env:ProgramFiles\CMake\bin;"
cmake ${{ env.CMAKE_TARGET_PLATFORM }} ${{ env.CMAKE_GENERATOR }} ${{ env.CMAKE_BUILD_TYPE }} -S ${{ github.workspace }} -B ${{ env.CMAKE_BUILD_DIR }} -DLIBRARY_BINARY_DIR=${{ env.LIBRARY_BINARY_DIR }} -DPROGRAM_VERSION="${{ github.event.repository.updated_at }}"
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Build
run: >-
cmake
--build ${{ env.CMAKE_BUILD_DIR }}
--config ${{ env.CMAKE_CONFIG_TYPE }}
--parallel ${{ steps.cpu-cores.outputs.count }}
# - name: Build
# run: >-
# cmake
# --build ${{ env.CMAKE_BUILD_DIR }}
# --config ${{ env.CMAKE_CONFIG_TYPE }}
# --parallel ${{ steps.cpu-cores.outputs.count }}

- name: Build (MinGW)
if: ${{ 'mingw' == matrix.compiler }}
run: |
$Env:PATH="C:\mingw64\bin;$Env:SystemRoot\system32;$Env:SystemRoot;$Env:SystemRoot\system32\Wbem;$Env:SystemRoot\system32\WindowsPowerShell\v1.0\;$Env:ProgramFiles\CMake\bin;"
cmake --build ${{ env.CMAKE_BUILD_DIR }} --config ${{ env.CMAKE_CONFIG_TYPE }} --parallel ${{ steps.cpu-cores.outputs.count }}
- name: Run main application
run: ${{ env.BINARY_PATH }}ant4c${{ env.EXECUTABLE_EXTENSION }}
Expand Down

0 comments on commit 2dc5acb

Please sign in to comment.