From 5107617db58ed76566835eaa5bb5ca4a318435f2 Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Tue, 19 Dec 2023 17:21:24 +1100 Subject: ci: clean up windows workflow --- .github/workflows/windows.yml | 66 ++++++++++++++++++++++++++++++++++++++ .github/workflows/windows_test.yml | 46 -------------------------- 2 files changed, 66 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/windows.yml delete mode 100644 .github/workflows/windows_test.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..421ebf3 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,66 @@ +# GitHub Actions workflow to run tests on Windows. +name: "Windows" + +on: + push: {} + pull_request: {} + schedule: + - cron: "0 0 * * 0" # At 00:00 weekly on Sunday. + +jobs: + test: + name: "${{ matrix.os }}/${{ matrix.arch }}${{ matrix.generator && ' (' + matrix.generator + ')' || '' }}" + runs-on: "${{ matrix.os }}" + permissions: + contents: read + strategy: + fail-fast: false + matrix: + os: ["windows-2022", "windows-2019"] + arch: ["ARM64", "x64", "Win32"] + include: + - os: "windows-2022" + generator: "Visual Studio 17 2022" + - os: "windows-2019" + generator: "Visual Studio 16 2019" + steps: + - name: "Checkout repository" + uses: actions/checkout@v4 + + - name: "Setup MSYS2" + uses: msys2/setup-msys2@v2 + with: + update: true + install: >- + autoconf + automake + diffutils + libtool + gcc + git + patch + perl + + - name: "Setup" + shell: msys2 {0} + run: ./autogen.sh + + - name: "Configure CMake" + shell: cmd + run: cmake -Bbuild -G "${{ matrix.generator }}" -A ${{ matrix.arch }} -DCMAKE_INSTALL_PREFIX=../local + + - name: "Build" + shell: cmd + run: cmake --build build --config Release + + - name: "Test" + if: matrix.arch != 'ARM64' + shell: cmd + run: ctest --test-dir build -C Release --output-on-failure + + - name: "Upload build artifacts" + if: always() + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.os }}-${{ matrix.arch }}-build-results" + path: "build" diff --git a/.github/workflows/windows_test.yml b/.github/workflows/windows_test.yml deleted file mode 100644 index bac948e..0000000 --- a/.github/workflows/windows_test.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: windows_ci - -on: [push, pull_request] - -jobs: - build-native: - strategy: - matrix: - os: [windows-2019, windows-2022] - arch: [Win32, x64, ARM64] - include: - - generator: "Visual Studio 16 2019" - os: windows-2019 - - generator: "Visual Studio 17 2022" - os: windows-2022 - runs-on: ${{ matrix.os }} - continue-on-error: false - name: ${{ matrix.os }} - ${{ matrix.arch }} - steps: - - uses: msys2/setup-msys2@v2 - with: - update: true - install: >- - autoconf - automake - diffutils - libtool - gcc - git - patch - perl - - uses: actions/checkout@main - - shell: msys2 {0} - run: ./autogen.sh - - shell: cmd - run: cmake -Bbuild -G "${{ matrix.generator }}" -A ${{ matrix.arch }} -DCMAKE_INSTALL_PREFIX=../local - - shell: cmd - run: cmake --build build --config Release - - shell: cmd - if: ${{ matrix.arch != 'ARM64' }} - run: ctest --test-dir build -C Release --output-on-failure - - uses: actions/upload-artifact@v3 - if: always() - with: - name: windows-build-results-${{ matrix.os }}-${{ matrix.arch }} - path: build -- cgit v1.2.3-55-g6feb