-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci, gha: Add Windows jobs based on Linux image
- Loading branch information
Showing
3 changed files
with
263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: 'Run in Docker with environment' | ||
description: 'Run a command in a Docker container, while passing explicitly set environment variables into the container.' | ||
inputs: | ||
dockerfile: | ||
description: 'A Dockerfile that defines an image' | ||
required: true | ||
tag: | ||
description: 'A tag of an image' | ||
required: true | ||
command: | ||
description: 'A command to run in a container' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: docker/setup-buildx-action@v2 | ||
with: | ||
# See: https://github.com/moby/buildkit/issues/3969. | ||
driver-opts: | | ||
network=host | ||
- uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ${{ inputs.dockerfile }} | ||
tags: ${{ inputs.tag }} | ||
push: false | ||
load: true | ||
cache-from: type=gha | ||
|
||
- # Tell Docker to pass environment variables in `env` into the container. | ||
run: > | ||
docker run \ | ||
$(echo '${{ toJSON(env) }}' | jq -r 'keys[] | "--env \(.) "') \ | ||
--volume ${{ github.workspace }}:${{ github.workspace }} \ | ||
--workdir ${{ github.workspace }} \ | ||
${{ inputs.tag }} bash -c "${{ inputs.command }}" | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM debian:stable-slim | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
WORKDIR /root | ||
|
||
# The "wine" package provides a convenience wrapper that we need | ||
RUN dpkg --add-architecture i386 && apt-get update && apt-get install --no-install-recommends -y \ | ||
autoconf automake libtool make \ | ||
gcc-mingw-w64-x86-64-win32 \ | ||
gcc-mingw-w64-i686-win32 \ | ||
git ca-certificates wine64 wine32:i386 wine python3-simplejson python3-six msitools winbind procps && \ | ||
# Workaround for `wine` package failure to employ the Debian alternatives system properly. | ||
ln -s /usr/lib/wine/wine64 /usr/bin/wine64 && \ | ||
# Set of tools for using MSVC on Linux. | ||
git clone https://github.com/mstorsjo/msvc-wine && \ | ||
mkdir /opt/msvc && \ | ||
python3 msvc-wine/vsdownload.py --accept-license --dest /opt/msvc Microsoft.VisualStudio.Workload.VCTools && \ | ||
# Since commit 2146cbfaf037e21de56c7157ec40bb6372860f51, the | ||
# msvc-wine effectively initializes the wine prefix when running | ||
# the install.sh script. | ||
msvc-wine/install.sh /opt/msvc && \ | ||
# Wait until the wineserver process has exited before closing the session, | ||
# to avoid corrupting the wine prefix. | ||
while (ps -A | grep wineserver) > /dev/null; do sleep 1; done |