diff options
Diffstat (limited to '.github/workflows/windows.yml')
-rw-r--r-- | .github/workflows/windows.yml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..e68ef4d --- /dev/null +++ b/.github/workflows/windows.yml | |||
@@ -0,0 +1,63 @@ | |||
1 | # GitHub Actions workflow to run tests on Windows. | ||
2 | name: "Windows" | ||
3 | |||
4 | on: | ||
5 | push: {} | ||
6 | pull_request: {} | ||
7 | schedule: | ||
8 | - cron: "0 0 * * 0" # At 00:00 weekly on Sunday. | ||
9 | |||
10 | jobs: | ||
11 | test: | ||
12 | name: "${{ matrix.os }}/${{ matrix.arch }} (${{ matrix.generator }})" | ||
13 | runs-on: "${{ matrix.os }}" | ||
14 | permissions: | ||
15 | contents: read | ||
16 | strategy: | ||
17 | fail-fast: false | ||
18 | matrix: | ||
19 | os: ["windows-2022", "windows-2019"] | ||
20 | arch: ["ARM64", "x64", "Win32"] | ||
21 | include: | ||
22 | - os: "windows-2022" | ||
23 | generator: "Visual Studio 17 2022" | ||
24 | - os: "windows-2019" | ||
25 | generator: "Visual Studio 16 2019" | ||
26 | steps: | ||
27 | - name: "Checkout repository" | ||
28 | uses: actions/checkout@v4 | ||
29 | |||
30 | - name: "Setup MSYS2" | ||
31 | uses: msys2/setup-msys2@v2 | ||
32 | with: | ||
33 | update: true | ||
34 | install: >- | ||
35 | diffutils | ||
36 | gcc | ||
37 | git | ||
38 | patch | ||
39 | perl | ||
40 | |||
41 | - name: "Update" | ||
42 | shell: msys2 {0} | ||
43 | run: ./update.sh | ||
44 | |||
45 | - name: "Configure CMake" | ||
46 | shell: cmd | ||
47 | run: cmake -Bbuild -G "${{ matrix.generator }}" -A ${{ matrix.arch }} -DCMAKE_INSTALL_PREFIX=../local | ||
48 | |||
49 | - name: "Build" | ||
50 | shell: cmd | ||
51 | run: cmake --build build --config Release | ||
52 | |||
53 | - name: "Test" | ||
54 | if: matrix.arch != 'ARM64' | ||
55 | shell: cmd | ||
56 | run: ctest --test-dir build -C Release --output-on-failure | ||
57 | |||
58 | - name: "Upload build artifacts" | ||
59 | if: always() | ||
60 | uses: actions/upload-artifact@v4 | ||
61 | with: | ||
62 | name: "${{ matrix.os }}-${{ matrix.arch }}-build-results" | ||
63 | path: "build" | ||