diff --git a/.github/workflows/c-std.yml b/.github/workflows/c-std.yml index 64a1c86f..a0e6a9e2 100644 --- a/.github/workflows/c-std.yml +++ b/.github/workflows/c-std.yml @@ -133,18 +133,30 @@ jobs: - name: Generate project files (cmake) if: matrix.builder == 'cmake' run: | - cmake -S . -B . -D CMAKE_BUILD_TYPE=Release ${{ matrix.os.cmake-opt }} -DZLIB_BUILD_MINIZIP=ON + cmake -S . -B ./build1 -D CMAKE_BUILD_TYPE=Release ${{ matrix.os.cmake-opt }} -DZLIB_BUILD_TESTING=OFF env: CC: ${{ matrix.compiler }} CFLAGS: -std=${{ matrix.std.value }} ${{ matrix.arch.compiler-opt }} -Werror -Wall -Wextra + - name: Generate project files with tests (cmake) + if: matrix.builder == 'cmake' + run: | + cmake -S . -B ./build2 -D CMAKE_BUILD_TYPE=Release ${{ matrix.os.cmake-opt }} -DZLIB_BUILD_MINIZIP=ON + env: + CC: ${{ matrix.compiler }} + CFLAGS: -std=${{ matrix.std.value }} ${{ matrix.arch.compiler-opt }} -Wall -Wextra + - name: Compile source code (cmake) if: matrix.builder == 'cmake' - run: cmake --build . --config Release + run: cmake --build ./build1 --config Release + + - name: Compile source code with tests (cmake) + if: matrix.builder == 'cmake' + run: cmake --build ./build --config Release - name: Run test cases (cmake) if: matrix.builder == 'cmake' - run: ctest -C Release --output-on-failure --max-width 120 + run: ctest ./build2 -C Release --output-on-failure --max-width 120 msvc: @@ -196,13 +208,23 @@ jobs: - name: Generate project files (cmake) run: | - cmake -S . -B . ${{ matrix.arch.value }} -D CMAKE_BUILD_TYPE=Release -DZLIB_BUILD_MINIZIP=ON + cmake -S . -B ./build1 ${{ matrix.arch.value }} -D CMAKE_BUILD_TYPE=Release -DZLIB_BUILD_TESTING=OFF env: CC: ${{ matrix.compiler }} CFLAGS: /WX ${{ matrix.std.value }} + - name: Generate project files with tests (cmake) + run: | + cmake -S . -B ./build2 ${{ matrix.arch.value }} -D CMAKE_BUILD_TYPE=Release -DZLIB_BUILD_MINIZIP=ON + env: + CC: ${{ matrix.compiler }} + CFLAGS: ${{ matrix.std.value }} + - name: Compile source code (cmake) - run: cmake --build . --config Release -v + run: cmake --build ./build1 --config Release -v + + - name: Compile source code with tests(cmake) + run: cmake --build ./build2 --config Release -v - name: Run test cases (cmake) - run: ctest -C Release --output-on-failure --max-width 120 + run: ctest ./build2 -C Release --output-on-failure --max-width 120