diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 86d890c..a670a69 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -3,7 +3,40 @@ name: "CI tests" on: [ push, workflow_dispatch ] jobs: - build: + build-mingw: + name: Tests and application run on Windows Latest MinGW + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Create CMake cache + run: | + cmake -S . -B cmake-build-release -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" + cmake -S . -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" + + - name: Build main target + shell: bash + run: | + cmake --build cmake-build-release --target cpp_tests || echo Built with errors + + - name: Build tests target + shell: bash + run: | + cmake --build cmake-build-debug --target cpp_tests_tests || echo Built with errors + + - name: Run program + working-directory: .\cmake-build-release + run: | + .\cpp_tests.exe --help + + - name: Run tests + working-directory: .\cmake-build-debug + run: | + echo "Currently unable to run tests on Windows Latest MinGW. See https://gitmemories.com/cristianadam/HelloWorld/issues/12 and https://github.com/microsoft/vscode-cmake-tools/issues/2451" + % .\cpp_tests_tests.exe + + build-matrix: name: Tests and application run on ${{ matrix.config.name }} runs-on: ${{ matrix.config.os }} strategy: @@ -16,11 +49,6 @@ jobs: build_type: "Release", cc: "cl", cxx: "cl", environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat" } - - { - name: "Windows Latest MinGW", artifact: "Windows-MinGW.tar.xz", - os: windows-latest, - build_type: "Release", cc: "gcc", cxx: "g++" - } - { name: "Ubuntu Latest GCC", artifact: "Linux.tar.xz", os: ubuntu-latest, @@ -33,18 +61,13 @@ jobs: } steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create CMake cache shell: bash run: | - if [ "${{ matrix.config.cxx }}" == "g++" ]; then - cmake -S . -B cmake-build-release -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" - cmake -S . -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" - else - cmake -S . -B cmake-build-release -DCMAKE_BUILD_TYPE=Release - cmake -S . -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug - fi + cmake -S . -B cmake-build-release -DCMAKE_BUILD_TYPE=Release + cmake -S . -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug - name: Build main target shell: bash @@ -72,12 +95,7 @@ jobs: working-directory: ./cmake-build-debug run: | if [ "$RUNNER_OS" == "Windows" ]; then - if [ "${{ matrix.config.cxx }}" == "g++" ]; then - echo "Currently unable to run tests on ${{ matrix.config.name }}. See https://gitmemories.com/cristianadam/HelloWorld/issues/12 and https://github.com/microsoft/vscode-cmake-tools/issues/2451" - # ./cpp_tests_tests.exe - else - ./cpp_tests_tests.exe - fi + ./cpp_tests_tests.exe else cd tests ./cpp_tests_tests @@ -87,7 +105,7 @@ jobs: name: Find memory leaks in tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install valgrind run: |