File: windows-build.yml

package info (click to toggle)
expat 2.7.5-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 133,656 kB
  • sloc: xml: 610,598; ansic: 29,752; sh: 725; makefile: 402; cpp: 376; python: 137
file content (116 lines) | stat: -rw-r--r-- 3,950 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#                          __  __            _
#                       ___\ \/ /_ __   __ _| |_
#                      / _ \\  /| '_ \ / _` | __|
#                     |  __//  \| |_) | (_| | |_
#                      \___/_/\_\ .__/ \__,_|\__|
#                               |_| XML parser
#
# Copyright (c) 2025 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license:
#
# Permission is  hereby granted,  free of charge,  to any  person obtaining
# a  copy  of  this  software   and  associated  documentation  files  (the
# "Software"),  to  deal in  the  Software  without restriction,  including
# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
# distribute, sublicense, and/or sell copies of the Software, and to permit
# persons  to whom  the Software  is  furnished to  do so,  subject to  the
# following conditions:
#
# The above copyright  notice and this permission notice  shall be included
# in all copies or substantial portions of the Software.
#
# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.

name: Build on Windows

on:
  pull_request:
  push:
  schedule:
    - cron: '0 2 * * 5'  # Every Friday at 2am
  workflow_dispatch:

permissions:
  contents: read

jobs:
  windows_build:
    name: Build on Windows (${{ matrix.runs-on }}, ${{ matrix.cmake_platform }}, ${{ matrix.expat_char_type }})
    strategy:
      fail-fast: false
      matrix:
        include:
          - runs-on: windows-2025
            cmake_build_type: Debug
            cmake_generator: Visual Studio 17 2022
            cmake_platform: Win32
            expat_char_type: char
            expat_dll: libexpatd.dll
          - runs-on: windows-2022
            cmake_build_type: Debug
            cmake_generator: Visual Studio 17 2022
            cmake_platform: x64
            expat_char_type: wchar_t
            expat_dll: libexpatwd.dll
    defaults:
      run:
        shell: bash
    runs-on: "${{ matrix.runs-on }}"
    steps:
    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2

    - uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce  # v2

    - name: Configure
      env:
        cmake_build_type: ${{ matrix.cmake_build_type }}
        cmake_generator: ${{ matrix.cmake_generator }}
        cmake_platform: ${{ matrix.cmake_platform }}
        expat_char_type: ${{ matrix.expat_char_type }}
      run: |-
        cmake_args=(
          -A "${cmake_platform}"
          -G "${cmake_generator}"
          -DCMAKE_BUILD_TYPE="${cmake_build_type}"
          -DEXPAT_CHAR_TYPE="${expat_char_type}"
          -DEXPAT_WARNINGS_AS_ERRORS=ON
          -Wdev
          -Wdeprecated
        )
        set -x
        cd expat
        mkdir build
        cmake -S . -B build "${cmake_args[@]}"

    - name: Build
      env:
        cmake_build_type: ${{ matrix.cmake_build_type }}
      run: |-
        msbuild_args=(
          -m
          -property:Configuration="${cmake_build_type}"
        )
        set -x
        cd expat/build
        MSBuild.exe "${msbuild_args[@]}" expat.sln

    - name: Run tests
      env:
        cmake_build_type: ${{ matrix.cmake_build_type }}
        expat_dll: ${{ matrix.expat_dll }}
      run: |-
        ctest_args=(
          --build-config "${cmake_build_type}"
          --output-on-failure
          --parallel 2
        )
        set -x
        cd expat/build
        cp -v "${cmake_build_type}/${expat_dll}" "tests/${cmake_build_type}/"
        ctest "${ctest_args[@]}"