[PATCH] ci: build with MSVC in GHA
Aaron Conole
aconole at redhat.com
Tue Feb 18 14:32:26 CET 2025
David Marchand <david.marchand at redhat.com> writes:
> Add a build target in Windows 2022 for MSVC.
>
> Loading MSVC environment and having successive commands in a single
> (cmd or pwsh) shell does not seem to correctly report if one of the
> commands failed.
> For now, load MSVC environment and run commands in separate shells.
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
LGTM.
Acked-by: Aaron Conole <aconole at redhat.com>
How far back will this work (ie: can we backport this to older branches?)
> .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 38 insertions(+)
>
> diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
> index dcafb4a8f5..aef692ca1f 100644
> --- a/.github/workflows/build.yml
> +++ b/.github/workflows/build.yml
> @@ -174,6 +174,44 @@ jobs:
> build/meson-logs/meson-log.txt
> build/meson-logs/testlog.txt
>
> + windows-vm-builds:
> + name: ${{ join(matrix.config.*, '-') }}
> + runs-on: ${{ matrix.config.os }}
> + strategy:
> + fail-fast: false
> + matrix:
> + config:
> + - os: windows-2022
> + compiler: msvc
> +
> + steps:
> + - name: Checkout sources
> + uses: actions/checkout at v4
> + - name: Set up Python
> + uses: actions/setup-python at v5
> + with:
> + python-version: '3.x'
> + - name: Install dependencies
> + run: python -m pip install meson==1.6.1 ninja
> + - name: Configure
> + shell: cmd
> + run: |
> + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
> + meson setup -Denable_stdatomic=true build
> + - name: Build
> + shell: cmd
> + run: |
> + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
> + meson compile -C build
> + - name: Upload logs on failure
> + if: failure()
> + uses: actions/upload-artifact at v4
> + with:
> + name: meson-logs-${{ join(matrix.config.*, '-') }}
> + path: |
> + build/.ninja_log
> + build/meson-logs/meson-log.txt
> +
> prepare-container-images:
> name: ${{ join(matrix.config.*, '-') }}
> runs-on: ubuntu-latest
More information about the dev
mailing list