Skip to content

Commit 2b6f9cd

Browse files
committed
ci, gha: Add Windows jobs based on Linux image
1 parent 48b1d93 commit 2b6f9cd

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 'Run in Docker with environment'
2+
description: 'Run a command in a Docker container, while passing explicitly set environment variables into the container.'
3+
inputs:
4+
dockerfile:
5+
description: 'A Dockerfile that defines an image'
6+
required: true
7+
tag:
8+
description: 'A tag of an image'
9+
required: true
10+
command:
11+
description: 'A command to run in a container'
12+
required: true
13+
runs:
14+
using: "composite"
15+
steps:
16+
- uses: docker/setup-buildx-action@v2
17+
with:
18+
# See: https://github.com/moby/buildkit/issues/3969.
19+
driver-opts: |
20+
network=host
21+
22+
- uses: docker/build-push-action@v4
23+
with:
24+
context: .
25+
file: ${{ inputs.dockerfile }}
26+
tags: ${{ inputs.tag }}
27+
load: true
28+
cache-from: type=gha
29+
30+
- # Tell Docker to pass environment variables in `env` into the container.
31+
run: >
32+
docker run \
33+
$(echo '${{ toJSON(env) }}' | jq -r 'keys[] | "--env \(.) "') \
34+
--volume ${{ github.workspace }}:${{ github.workspace }} \
35+
--workdir ${{ github.workspace }} \
36+
${{ inputs.tag }} bash -c "${{ inputs.command }}"
37+
shell: bash

.github/workflows/ci.yml

+76
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,82 @@ env:
4242
EXAMPLES: 'yes'
4343

4444
jobs:
45+
docker_cache:
46+
name: "Build Docker image"
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@v2
51+
with:
52+
# See: https://github.com/moby/buildkit/issues/3969.
53+
driver-opts: |
54+
network=host
55+
56+
- name: Build container
57+
uses: docker/build-push-action@v4
58+
with:
59+
file: ./ci/linux-debian.Dockerfile
60+
tags: linux-debian-image
61+
cache-from: type=gha
62+
cache-to: type=gha,mode=min
63+
64+
mingw_debian:
65+
name: ${{ matrix.configuration.job_name }}
66+
runs-on: ubuntu-latest
67+
needs: docker_cache
68+
69+
env:
70+
WRAPPER_CMD: 'wine'
71+
WITH_VALGRIND: 'no'
72+
ECDH: 'yes'
73+
RECOVERY: 'yes'
74+
SCHNORRSIG: 'yes'
75+
ELLSWIFT: 'yes'
76+
CTIMETESTS: 'no'
77+
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
configuration:
82+
- job_name: 'x86_64 (mingw32-w64): Windows (Debian stable, Wine)'
83+
env_vars:
84+
HOST: 'x86_64-w64-mingw32'
85+
- job_name: 'i686 (mingw32-w64): Windows (Debian stable, Wine)'
86+
env_vars:
87+
HOST: 'i686-w64-mingw32'
88+
89+
steps:
90+
- name: Checkout
91+
uses: actions/checkout@v3
92+
93+
- name: CI script
94+
env: ${{ matrix.configuration.env_vars }}
95+
uses: ./.github/actions/run-in-docker-action
96+
with:
97+
dockerfile: ./ci/linux-debian.Dockerfile
98+
tag: linux-debian-image
99+
command: >
100+
git config --global --add safe.directory ${{ github.workspace }} &&
101+
./ci/cirrus.sh
102+
103+
- run: cat tests.log || true
104+
if: ${{ always() }}
105+
- run: cat noverify_tests.log || true
106+
if: ${{ always() }}
107+
- run: cat exhaustive_tests.log || true
108+
if: ${{ always() }}
109+
- run: cat ctime_tests.log || true
110+
if: ${{ always() }}
111+
- run: cat bench.log || true
112+
if: ${{ always() }}
113+
- run: cat config.log || true
114+
if: ${{ always() }}
115+
- run: cat test_env.log || true
116+
if: ${{ always() }}
117+
- name: CI env
118+
run: env
119+
if: ${{ always() }}
120+
45121
macos-native:
46122
name: "x86_64: macOS Ventura"
47123
# See: https://github.com/actions/runner-images#available-images.

0 commit comments

Comments
 (0)