@@ -103,46 +103,57 @@ jobs:
103103 - name : Compute image name
104104 run : echo "DOCKER_IMAGE=localhost/${{ github.repository }}/${{ steps.const.outputs.os-string }}" >> ${GITHUB_ENV}
105105 - name : " Registry login: ghcr.io"
106+ if : matrix.os.name != 'windows'
106107 run : |
107108 echo ${{ secrets.GITHUB_TOKEN }} |
108109 docker login -u sys-lzdev --password-stdin ghcr.io
109110 - name : Verify Docker configuration
111+ if : matrix.os.name != 'windows'
110112 run : |
111113 docker version
112114 docker info
113115 - name : Build image
116+ if : matrix.os.name != 'windows'
114117 run : |
115118 docker info
116- # Force Docker to use the correct container type
117- ${{ matrix.os.name == 'windows' && 'docker context use default' || '' }}
118119 docker build \
119- ${{ runner.os == 'Windows' && ' \
120- --memory 16G ' || ' '
121- }}\
122- ${{ matrix.os.name == 'windows' && ' \
123- --platform windows/amd64 \
124- --isolation process ' || ' \
125- --platform linux/amd64 '
126- }}\
120+ --platform linux/amd64 \
127121 ${{ matrix.os.vmaj != '' && format(' \
128122 --build-arg VMAJ={0} \
129123 --build-arg VMIN={1} ', matrix.os.vmaj, matrix.os.vmin) || ' '
130124 }}\
131125 --pull \
132126 --tag ${DOCKER_IMAGE}:${{ needs.config.outputs.ref-slug }} \
133127 - < .github/docker/${{ matrix.os.name }}.Dockerfile
134- - name : Build
128+ - name : Setup Windows build environment
129+ if : matrix.os.name == 'windows'
130+ uses : ilammy/msvc-dev-cmd@v1
131+ with :
132+ arch : x64
133+ - name : Build (Windows)
134+ if : matrix.os.name == 'windows'
135+ run : |
136+ mkdir build
137+ cd build
138+ cmake `
139+ -G "Visual Studio 17 2022" `
140+ -A x64 `
141+ -D CMAKE_BUILD_TYPE=Release `
142+ -D CMAKE_INSTALL_PREFIX="${{ matrix.target == 'install' && '../level-zero-install' || matrix.target == 'package' && 'C:/Program Files' || '' }}" `
143+ -D CPACK_OUTPUT_FILE_PREFIX="${{ github.workspace }}/level-zero-package" `
144+ ..
145+ cmake --build . --config Release --target ${{ matrix.target }}
146+ shell : powershell
147+ - name : Build (Linux)
148+ if : matrix.os.name != 'windows'
135149 id : build
136150 run : |
137151 mkdir build
152+ # Container-based build for Linux
138153 docker run \
139154 --rm \
140155 --interactive \
141- ${{ matrix.os.name == 'windows' && ' \
142- --platform windows/amd64 \
143- --isolation process ' || ' \
144- --platform linux/amd64 '
145- }}\
156+ --platform linux/amd64 \
146157 -v '${{ github.workspace }}':${MOUNT_TARGET} \
147158 -w ${MOUNT_TARGET}/build \
148159 -e CCACHE_BASEDIR=${MOUNT_TARGET} \
@@ -152,9 +163,7 @@ jobs:
152163 bash -e -x <<-EOF
153164
154165 cmake \
155- ${{ matrix.os.name != 'windows' && ' \
156- -G Ninja ' || ' '
157- }}\
166+ -G Ninja \
158167 ${{ matrix.arch == 'arm64' && ' \
159168 -D CMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
160169 -D CMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
@@ -167,7 +176,7 @@ jobs:
167176 -D CPACK_OUTPUT_FILE_PREFIX=${MOUNT_TARGET}/level-zero-package \
168177 ..
169178
170- cmake --build . ${PARALLEL} --target ${{ matrix.target }} ${{ matrix.os.name == 'windows' && '--config Release' || '' }}
179+ cmake --build . ${PARALLEL} --target ${{ matrix.target }}
171180
172181 ccache --show-stats
173182
0 commit comments