Skip to content

Commit e044aba

Browse files
committed
Remove windows docker build
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent 41ad5c6 commit e044aba

2 files changed

Lines changed: 57 additions & 28 deletions

File tree

.github/workflows/build-multi-static.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,30 +103,52 @@ 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: Build image
111+
if: matrix.os.name != 'windows'
110112
run: |
111113
docker info
112114
docker build \
113-
${{ runner.os == 'Windows' && ' \
114-
--memory 16G ' || ' '
115-
}}\
115+
--platform linux/amd64 \
116116
${{ matrix.os.vmaj != '' && format(' \
117117
--build-arg VMAJ={0} \
118118
--build-arg VMIN={1} ', matrix.os.vmaj, matrix.os.vmin) || ' '
119119
}}\
120120
--pull \
121121
--tag ${DOCKER_IMAGE}:${{ needs.config.outputs.ref-slug }} \
122122
- < .github/docker/${{ matrix.os.name }}.Dockerfile
123-
- name: Build
123+
- name: Setup Windows build environment
124+
if: matrix.os.name == 'windows'
125+
uses: ilammy/msvc-dev-cmd@v1
126+
with:
127+
arch: x64
128+
- name: Build (Windows)
129+
if: matrix.os.name == 'windows'
130+
run: |
131+
mkdir build
132+
cd build
133+
cmake `
134+
-G "Visual Studio 17 2022" `
135+
-A x64 `
136+
-D CMAKE_BUILD_TYPE=Release `
137+
-D BUILD_STATIC=1 `
138+
-D CMAKE_INSTALL_PREFIX="${{ matrix.target == 'install' && '../level-zero-install' || matrix.target == 'package' && 'C:/Program Files' || '' }}" `
139+
-D CPACK_OUTPUT_FILE_PREFIX="${{ github.workspace }}/level-zero-package" `
140+
..
141+
cmake --build . --config Release --target ${{ matrix.target }}
142+
shell: powershell
143+
- name: Build (Linux)
144+
if: matrix.os.name != 'windows'
124145
id: build
125146
run: |
126147
mkdir build
127148
docker run \
128149
--rm \
129150
--interactive \
151+
--platform linux/amd64 \
130152
-v '${{ github.workspace }}':${MOUNT_TARGET} \
131153
-w ${MOUNT_TARGET}/build \
132154
-e CCACHE_BASEDIR=${MOUNT_TARGET} \
@@ -136,9 +158,7 @@ jobs:
136158
bash -e -x <<-EOF
137159
138160
cmake \
139-
${{ matrix.os.name != 'windows' && ' \
140-
-G Ninja ' || ' '
141-
}}\
161+
-G Ninja \
142162
${{ matrix.arch == 'arm64' && ' \
143163
-D CMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
144164
-D CMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
@@ -152,7 +172,7 @@ jobs:
152172
-D CPACK_OUTPUT_FILE_PREFIX=${MOUNT_TARGET}/level-zero-package \
153173
..
154174
155-
cmake --build . ${PARALLEL} --target ${{ matrix.target }} ${{ matrix.os.name == 'windows' && '--config Release' || '' }}
175+
cmake --build . ${PARALLEL} --target ${{ matrix.target }}
156176
157177
ccache --show-stats
158178

.github/workflows/build-multi.yml

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)