|
11 | 11 | - main |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - build_msvc: |
15 | | - name: Building on MSVC ${{ matrix.msvc_version }} |
16 | | - runs-on: windows-latest |
| 14 | + build: |
| 15 | + name: Build and Test on ${{ matrix.os }} |
| 16 | + runs-on: ${{ matrix.os }} |
17 | 17 | strategy: |
18 | 18 | matrix: |
19 | | - msvc_version: [2019, 2022, 2025] |
| 19 | + os: [ubuntu-latest, macos-latest, windows-latest] |
20 | 20 | steps: |
21 | 21 | - name: Checkout code |
22 | | - uses: actions/checkout@v5 |
23 | | - with: |
24 | | - fetch-depth: 0 |
25 | | - |
| 22 | + uses: actions/checkout@v4 |
26 | 23 | - name: Set up Python |
27 | | - uses: actions/setup-python@v6 |
| 24 | + uses: actions/setup-python@v5 |
28 | 25 | with: |
29 | 26 | python-version: '3.12' |
30 | | - |
31 | | - - name: Install Meson and Ninja |
32 | | - shell: pwsh |
33 | | - run: | |
34 | | - python -m pip install --upgrade pip |
35 | | - python -m pip install meson ninja |
36 | | - if ($env:msvc_version -eq "2019") { |
37 | | - choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive" |
38 | | - } elseif ($env:msvc_version -eq "2022") { |
39 | | - choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive" |
40 | | - } elseif ($env:msvc_version -eq "2025") { |
41 | | - choco install visualstudio2025buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive" |
42 | | - } |
43 | | - $env:CC="cl.exe" |
44 | | - $env:CXX="cl.exe" |
45 | | -
|
46 | | - - name: Configure |
47 | | - run: meson setup builddir_msvc_${{ matrix.msvc_version }} --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 |
48 | | - |
49 | | - - name: Run Tests |
50 | | - run: meson test -C builddir_msvc_${{ matrix.msvc_version }} -v --test-args='show --mode tree --verbose ci --result fail' |
51 | | - |
52 | | - build_macosx: |
53 | | - name: Building on MacOSX |
54 | | - runs-on: macos-latest |
55 | | - steps: |
56 | | - - name: Checkout code |
57 | | - uses: actions/checkout@v5 |
58 | | - with: |
59 | | - fetch-depth: 0 |
60 | | - |
61 | | - - name: Set up Python |
62 | | - uses: actions/setup-python@v6 |
63 | | - with: |
64 | | - python-version: '3.12' |
65 | | - |
66 | | - - name: Install Xcode Command Line Tools |
67 | | - run: | |
68 | | - if ! xcode-select -p &>/dev/null; then |
69 | | - sudo xcode-select --install |
70 | | - until xcode-select -p &>/dev/null; do sleep 5; done |
71 | | - fi |
72 | | -
|
73 | | - - name: Install Xcode |
74 | | - run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer |
75 | | - |
76 | | - - name: Install Meson, Ninja |
77 | | - run: | |
78 | | - python -m pip install meson ninja |
79 | | -
|
80 | | - - name: Configure |
81 | | - run: OBJC=clang OBJCXX=clang++ meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 |
82 | | - |
83 | | - - name: Compile |
84 | | - run: meson compile -C builddir |
85 | | - |
| 27 | + - name: Install dependencies |
| 28 | + run: python3 -m pip install meson==1.8.0 ninja |
| 29 | + - name: Configure Project |
| 30 | + run: meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 |
| 31 | + env: |
| 32 | + CC: gcc |
86 | 33 | - name: Run Tests |
87 | | - run: meson test -C builddir -v |
88 | | - |
| 34 | + run: meson test -C builddir -v --test-args='show --mode tree --result fail' |
89 | 35 | - name: Upload Test Log |
90 | | - if: failure() |
91 | 36 | uses: actions/upload-artifact@v4 |
| 37 | + if: failure() |
92 | 38 | with: |
93 | | - name: macos_xcode_${{ matrix.xcode_version }}_meson_testlog |
| 39 | + name: ${{ matrix.os }}_Meson_Testlog |
94 | 40 | path: builddir/meson-logs/testlog.txt |
95 | | - |
96 | | - build_msys: |
97 | | - name: Building on MSYS ${{ matrix.architecture }} |
98 | | - runs-on: windows-latest |
99 | | - strategy: |
100 | | - matrix: |
101 | | - architecture: [x86, x64] |
102 | | - steps: |
103 | | - - name: Checkout code |
104 | | - uses: actions/checkout@v5 |
105 | | - with: |
106 | | - fetch-depth: 0 |
107 | | - |
108 | | - - name: Set up MSYS2 |
109 | | - uses: msys2/setup-msys2@v2 |
110 | | - with: |
111 | | - update: true |
112 | | - |
113 | | - - name: Set environment variables |
114 | | - run: | |
115 | | - echo "CC=/mingw${{ matrix.architecture }}/bin/gcc.exe" >> $GITHUB_ENV |
116 | | - echo "CXX=/mingw${{ matrix.architecture }}/bin/g++.exe" >> $GITHUB_ENV |
117 | | -
|
118 | | - - name: Set up Python |
119 | | - uses: actions/setup-python@v6 |
120 | | - with: |
121 | | - python-version: '3.12' |
122 | | - |
123 | | - - name: Install Meson and Ninja |
124 | | - run: | |
125 | | - python -m pip install meson ninja |
126 | | -
|
127 | | - - name: Configure |
128 | | - run: meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 |
129 | | - |
130 | | - - name: Run Tests |
131 | | - run: meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail' |
132 | | - |
133 | | - build_mingw: |
134 | | - name: Building on MinGW ${{ matrix.architecture }} |
135 | | - runs-on: windows-latest |
136 | | - strategy: |
137 | | - matrix: |
138 | | - architecture: [x86, x64] |
139 | | - steps: |
140 | | - - name: Checkout code |
141 | | - uses: actions/checkout@v5 |
142 | | - with: |
143 | | - fetch-depth: 0 |
144 | | - |
145 | | - - name: Install MinGW |
146 | | - run: | |
147 | | - choco install mingw |
148 | | -
|
149 | | - - name: Set environment variables |
150 | | - run: | |
151 | | - if ($env:matrix_architecture -eq "x86") { |
152 | | - $env:CC="C:/tools/mingw32/bin/gcc.exe" |
153 | | - $env:CXX="C:/tools/mingw32/bin/g++.exe" |
154 | | - } else { |
155 | | - $env:CC="C:/tools/mingw64/bin/gcc.exe" |
156 | | - $env:CXX="C:/tools/mingw64/bin/g++.exe" |
157 | | - } |
158 | | -
|
159 | | - - name: Set up Python |
160 | | - uses: actions/setup-python@v6 |
161 | | - with: |
162 | | - python-version: '3.12' |
163 | | - |
164 | | - - name: Install Meson and Ninja |
165 | | - run: | |
166 | | - python -m pip install meson ninja |
167 | | -
|
168 | | - - name: Configure |
169 | | - run: meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 |
170 | | - |
171 | | - - name: Run Tests |
172 | | - run: meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail' |
173 | | - |
174 | | - build_posix: |
175 | | - name: Build on Linux ${{ matrix.distro }} |
176 | | - runs-on: ubuntu-latest |
177 | | - |
178 | | - strategy: |
179 | | - matrix: |
180 | | - distro: [ubuntu, fedora, archlinux, debian] # in a new experiment add alpine and opensuse |
181 | | - |
182 | | - steps: |
183 | | - - name: Checkout code |
184 | | - uses: actions/checkout@v5 |
185 | | - with: |
186 | | - fetch-depth: 0 |
187 | | - |
188 | | - - name: Set up Docker Buildx |
189 | | - uses: docker/setup-buildx-action@v3 |
190 | | - |
191 | | - - name: Cache Docker layers |
192 | | - uses: actions/cache@v4 |
193 | | - with: |
194 | | - path: /tmp/.buildx-cache |
195 | | - key: ${{ runner.os }}-buildx-${{ matrix.distro }} |
196 | | - restore-keys: | |
197 | | - ${{ runner.os }}-buildx |
198 | | -
|
199 | | - - name: Build Docker Image |
200 | | - run: | |
201 | | - docker build \ |
202 | | - --file .github/ciimage/Dockerfile.${{ matrix.distro }} \ |
203 | | - --tag ${GITHUB_REPOSITORY}:${{ matrix.distro }} . |
204 | | -
|
205 | | - - name: Run Meson Build in Docker Container |
206 | | - run: | |
207 | | - docker run --rm \ |
208 | | - -v ${{ github.workspace }}:/workspace \ |
209 | | - -w /workspace \ |
210 | | - ${GITHUB_REPOSITORY}:${{ matrix.distro }} \ |
211 | | - /bin/bash -c " |
212 | | - sudo apt update |
213 | | - meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 |
214 | | - meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail'" |
0 commit comments