diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f1659d7dd41..1e9d992dff5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,6 +1,14 @@ name: Windows - -on: [push, pull_request] +on: + push: + pull_request: + workflow_dispatch: + inputs: + run_tests: + description: 'Run unit tests' + required: false + type: boolean + default: true jobs: msbuild: @@ -11,36 +19,31 @@ jobs: toolset: [MSVC] configuration: [Release] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 - name: Build shell: cmd - run: msbuild Osiris.sln /p:Platform=x86 /p:Configuration=${{ matrix.configuration }} ${{ env.toolset }} - - uses: actions/upload-artifact@v3 + run: msbuild Osiris.sln /p:Platform=x86 /p:Configuration=${{ matrix.configuration }} + - uses: actions/upload-artifact@v4 with: - name: Osiris.dll + name: Osiris-dll-${{ matrix.os }}-${{ matrix.configuration }} path: Release/Osiris.dll - + cmake: runs-on: ${{ matrix.os }} strategy: matrix: os: [windows-2019, windows-2022] - toolset: [ClangCL, MSVC] + toolset: [MSVC] configuration: [Debug, Release] arch: [Win32, x64] - exclude: - - os: windows-2019 - toolset: ClangCL steps: - - uses: actions/checkout@v3 - - name: Set toolset - if: matrix.toolset == 'ClangCL' - run: echo "toolset=-T ${{ matrix.toolset }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: configure - run: cmake -Werror=dev -D BUILD_TESTS=1 -A ${{ matrix.arch }} ${{ env.toolset }} -B build - - name: build + - uses: actions/checkout@v4 + - name: Configure + run: cmake -Werror=dev -D BUILD_TESTS=1 -A ${{ matrix.arch }} -B build + - name: Build run: cmake --build build --config ${{ matrix.configuration }} - - name: run unit tests - run: ctest --test-dir build --output-on-failure --schedule-random -j $env:NUMBER_OF_PROCESSORS + - name: Run unit tests + if: github.event_name != 'workflow_dispatch' || inputs.run_tests + run: ctest --test-dir build --output-on-failure --schedule-random -C ${{ matrix.configuration }} -j $env:NUMBER_OF_PROCESSORS