ci: Run the tests on macOS.

This commit is contained in:
Giovanni Mascellani 2023-08-31 22:55:46 +02:00 committed by Alexandre Julliard
parent 45541dd9b2
commit d72c91ef97
Notes: Alexandre Julliard 2023-09-14 22:20:40 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/328
4 changed files with 86 additions and 6 deletions

View File

@ -14,7 +14,8 @@ The file build.yml contains the actual testing targets. Currently
vkd3d is tested on Linux, on x86-64 and i386, each architecture with vkd3d is tested on Linux, on x86-64 and i386, each architecture with
two different Vulkan drivers (both from Mesa): llvmpipe (a software two different Vulkan drivers (both from Mesa): llvmpipe (a software
implementation) and RADV (a hardware implementation backed by an AMD implementation) and RADV (a hardware implementation backed by an AMD
GPU). The testing logs are available as CI artifacts. GPU); and on macOS, on Intel, using MoltenVK as Vulkan driver. The
testing logs are available as CI artifacts.
Some custom runner configuration is required in order to run the tests Some custom runner configuration is required in order to run the tests
on an AMD GPU. Specifically, a runner tagged with `amd-gpu' must be on an AMD GPU. Specifically, a runner tagged with `amd-gpu' must be
@ -40,3 +41,11 @@ available with the following features:
is created dynamically, therefore has no predictable GID: the use is created dynamically, therefore has no predictable GID: the use
of a fixed GID enables the guest system to be set up so that the of a fixed GID enables the guest system to be set up so that the
user running the tests can access the render nodes. user running the tests can access the render nodes.
A runner on an Intel macOS system tagged with `mac' must also be
available to run the macOS tests. Unfortunately a system like Docker
is not available in this case to provide an isolated standard
environment for running the tests. All the software required to
compile and run the tests will therefore have to be installed directly
on the host system. Complete instructions to setup the macOS are
currently not available.

19
gitlab/build-mac Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
echo "Building $(git log -1)"
echo "---"
COMMIT=$(git rev-parse --short HEAD)
set -Eeuxo pipefail
./autogen.sh
rm -fr build
mkdir build
cd build
../configure && make -j$(sysctl -n hw.ncpu) && make -j$(sysctl -n hw.ncpu) crosstest && make -j$(sysctl -n hw.ncpu) check || touch ../pipeline_failed
mkdir -p ../artifacts/$COMMIT
rsync -Rr tests/*.exe test-suite.log tests/*.log tests/*/*.log ../artifacts/$COMMIT
git reset --hard

View File

@ -1,4 +1,4 @@
.build: .build-linux:
stage: build stage: build
rules: rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
@ -26,20 +26,20 @@
- artifacts - artifacts
build-radv-64: build-radv-64:
extends: .build extends: .build-linux
tags: tags:
- amd-gpu - amd-gpu
variables: variables:
VK_LOADER_DRIVERS_SELECT: 'radeon_*' VK_LOADER_DRIVERS_SELECT: 'radeon_*'
build-llvmpipe-64: build-llvmpipe-64:
extends: .build extends: .build-linux
allow_failure: true allow_failure: true
variables: variables:
VK_LOADER_DRIVERS_SELECT: 'lvp_*' VK_LOADER_DRIVERS_SELECT: 'lvp_*'
build-radv-32: build-radv-32:
extends: .build extends: .build-linux
tags: tags:
- amd-gpu - amd-gpu
variables: variables:
@ -47,8 +47,48 @@ build-radv-32:
CC: 'gcc -m32' CC: 'gcc -m32'
build-llvmpipe-32: build-llvmpipe-32:
extends: .build extends: .build-linux
allow_failure: true allow_failure: true
variables: variables:
VK_LOADER_DRIVERS_SELECT: 'lvp_*' VK_LOADER_DRIVERS_SELECT: 'lvp_*'
CC: 'gcc -m32' CC: 'gcc -m32'
build-mac:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
allow_failure: true
interruptible: true
needs: []
dependencies: []
tags:
- mac
script:
- git config --global --add safe.directory $CI_PROJECT_DIR
- git clean -fdx
- git reset --hard
- rm -fr .git/rebase-merge
# We use a custom ICD which is not marked as a portability driver,
# so that test programs are not confused.
- ./gitlab/patch_moltenvk_icd.sh
- export VK_DRIVER_FILES="$PWD/gitlab/MoltenVK_icd.json"
- mkdir artifacts
- system_profiler SPSoftwareDataType SPHardwareDataType > artifacts/systeminfo.txt
- vulkaninfo > artifacts/vulkaninfo.txt
- export PATH="/usr/local/opt/bison/bin:/usr/local/opt/flex/bin:$PATH"
- git clone --depth 1 --branch wine-3.21 https://gitlab.winehq.org/wine/wine.git
- cd wine
- mkdir build
- cd build
- ../configure --enable-win64 --without-x --without-freetype
- make tools/widl/widl
- cd ../..
- export PATH="$PWD/wine/build/tools/widl:$PATH"
- git rebase $CI_MERGE_REQUEST_DIFF_BASE_SHA --exec ./gitlab/build-mac
- if [ -f pipeline_failed ] ; then exit 1 ; fi
variables:
VKD3D_DISABLE_EXTENSIONS: "VK_EXT_descriptor_indexing"
artifacts:
when: always
paths:
- artifacts

12
gitlab/patch_moltenvk_icd.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
BASE_PATH="/usr/local/opt/molten-vk/share/vulkan/icd.d"
cp "$BASE_PATH/MoltenVK_icd.json" gitlab/MoltenVK_icd.json
# The driver path is relative
sed -i -e 's|"library_path" *: "|"library_path" : "'"$BASE_PATH/"'|g' gitlab/MoltenVK_icd.json
# We pretend this is not a portability driver, otherwise vkd3d won't
# find it
sed -i -e 's|"is_portability_driver" *: *true|"is_portability_driver" : false|g' gitlab/MoltenVK_icd.json