Skip to content

Commit 6b9507a

Browse files
committed
Merge bitcoin-core/secp256k1#1398: ci, gha: Add Windows jobs based on Linux image
87d35f3 ci: Rename `cirrus.sh` to more general `ci.sh` (Hennadii Stepanov) d6281dd ci: Remove Windows tasks from Cirrus CI (Hennadii Stepanov) 2b6f9cd ci, gha: Add Windows jobs based on Linux image (Hennadii Stepanov) Pull request description: ACKs for top commit: real-or-random: ACK 87d35f3 jonasnick: ACK 87d35f3 Tree-SHA512: bab005041692f52ed26899d50ee9114e6dd57a21ffa36b4d0b99e8b5b394a64a956cbc99ae2767fdf64f242970ebbeb0df4f5b373e059ecb187174f471b1a95e
2 parents 48b1d93 + 87d35f3 commit 6b9507a

File tree

4 files changed

+123
-31
lines changed

4 files changed

+123
-31
lines changed

.cirrus.yml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ task:
9393
- env:
9494
CC: clang-snapshot
9595
test_script:
96-
- ./ci/cirrus.sh
96+
- ./ci/ci.sh
9797
<< : *CAT_LOGS
9898

9999
task:
@@ -111,7 +111,7 @@ task:
111111
- env:
112112
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
113113
test_script:
114-
- ./ci/cirrus.sh
114+
- ./ci/ci.sh
115115
<< : *CAT_LOGS
116116

117117
task:
@@ -130,7 +130,7 @@ task:
130130
test_script:
131131
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
132132
- rm /etc/ld.so.cache
133-
- ./ci/cirrus.sh
133+
- ./ci/ci.sh
134134
<< : *CAT_LOGS
135135

136136
task:
@@ -150,7 +150,7 @@ task:
150150
- env: {}
151151
- env: {EXPERIMENTAL: yes, ASM: arm32}
152152
test_script:
153-
- ./ci/cirrus.sh
153+
- ./ci/ci.sh
154154
<< : *CAT_LOGS
155155

156156
task:
@@ -167,7 +167,7 @@ task:
167167
ELLSWIFT: yes
168168
CTIMETESTS: no
169169
test_script:
170-
- ./ci/cirrus.sh
170+
- ./ci/ci.sh
171171
<< : *CAT_LOGS
172172

173173
task:
@@ -184,28 +184,7 @@ task:
184184
ELLSWIFT: yes
185185
CTIMETESTS: no
186186
test_script:
187-
- ./ci/cirrus.sh
188-
<< : *CAT_LOGS
189-
190-
task:
191-
<< : *LINUX_CONTAINER
192-
env:
193-
WRAPPER_CMD: wine
194-
WITH_VALGRIND: no
195-
ECDH: yes
196-
RECOVERY: yes
197-
SCHNORRSIG: yes
198-
ELLSWIFT: yes
199-
CTIMETESTS: no
200-
matrix:
201-
- name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
202-
env:
203-
HOST: x86_64-w64-mingw32
204-
- name: "i686 (mingw32-w64): Windows (Debian stable, Wine)"
205-
env:
206-
HOST: i686-w64-mingw32
207-
test_script:
208-
- ./ci/cirrus.sh
187+
- ./ci/ci.sh
209188
<< : *CAT_LOGS
210189

211190
# Sanitizers
@@ -249,7 +228,7 @@ task:
249228
HOST: i686-linux-gnu
250229
CC: i686-linux-gnu-gcc
251230
test_script:
252-
- ./ci/cirrus.sh
231+
- ./ci/ci.sh
253232
<< : *CAT_LOGS
254233

255234
# Memory sanitizers
@@ -276,7 +255,7 @@ task:
276255
ECMULTWINDOW: 2
277256
CFLAGS: "-fsanitize=memory -g -O3"
278257
test_script:
279-
- ./ci/cirrus.sh
258+
- ./ci/ci.sh
280259
<< : *CAT_LOGS
281260

282261
task:
@@ -292,7 +271,7 @@ task:
292271
SCHNORRSIG: yes
293272
ELLSWIFT: yes
294273
test_script:
295-
- ./ci/cirrus.sh
274+
- ./ci/ci.sh
296275
<< : *CAT_LOGS
297276

298277
task:
Lines changed: 37 additions & 0 deletions
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

Lines changed: 77 additions & 1 deletion
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/ci.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.
@@ -80,7 +156,7 @@ jobs:
80156
81157
- name: CI script
82158
env: ${{ matrix.env_vars }}
83-
run: ./ci/cirrus.sh
159+
run: ./ci/ci.sh
84160

85161
- run: cat tests.log || true
86162
if: ${{ always() }}

ci/cirrus.sh renamed to ci/ci.sh

File renamed without changes.

0 commit comments

Comments
 (0)