Skip to content

Commit

Permalink
Merge #1398: ci, gha: Add Windows jobs based on Linux image
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jonasnick committed Aug 18, 2023
2 parents 48b1d93 + 87d35f3 commit 6b9507a
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 31 deletions.
39 changes: 9 additions & 30 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ task:
- env:
CC: clang-snapshot
test_script:
- ./ci/cirrus.sh
- ./ci/ci.sh
<< : *CAT_LOGS

task:
Expand All @@ -111,7 +111,7 @@ task:
- env:
CC: clang --target=i686-pc-linux-gnu -isystem /usr/i686-linux-gnu/include
test_script:
- ./ci/cirrus.sh
- ./ci/ci.sh
<< : *CAT_LOGS

task:
Expand All @@ -130,7 +130,7 @@ task:
test_script:
# https://sourceware.org/bugzilla/show_bug.cgi?id=27008
- rm /etc/ld.so.cache
- ./ci/cirrus.sh
- ./ci/ci.sh
<< : *CAT_LOGS

task:
Expand All @@ -150,7 +150,7 @@ task:
- env: {}
- env: {EXPERIMENTAL: yes, ASM: arm32}
test_script:
- ./ci/cirrus.sh
- ./ci/ci.sh
<< : *CAT_LOGS

task:
Expand All @@ -167,7 +167,7 @@ task:
ELLSWIFT: yes
CTIMETESTS: no
test_script:
- ./ci/cirrus.sh
- ./ci/ci.sh
<< : *CAT_LOGS

task:
Expand All @@ -184,28 +184,7 @@ task:
ELLSWIFT: yes
CTIMETESTS: no
test_script:
- ./ci/cirrus.sh
<< : *CAT_LOGS

task:
<< : *LINUX_CONTAINER
env:
WRAPPER_CMD: wine
WITH_VALGRIND: no
ECDH: yes
RECOVERY: yes
SCHNORRSIG: yes
ELLSWIFT: yes
CTIMETESTS: no
matrix:
- name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
env:
HOST: x86_64-w64-mingw32
- name: "i686 (mingw32-w64): Windows (Debian stable, Wine)"
env:
HOST: i686-w64-mingw32
test_script:
- ./ci/cirrus.sh
- ./ci/ci.sh
<< : *CAT_LOGS

# Sanitizers
Expand Down Expand Up @@ -249,7 +228,7 @@ task:
HOST: i686-linux-gnu
CC: i686-linux-gnu-gcc
test_script:
- ./ci/cirrus.sh
- ./ci/ci.sh
<< : *CAT_LOGS

# Memory sanitizers
Expand All @@ -276,7 +255,7 @@ task:
ECMULTWINDOW: 2
CFLAGS: "-fsanitize=memory -g -O3"
test_script:
- ./ci/cirrus.sh
- ./ci/ci.sh
<< : *CAT_LOGS

task:
Expand All @@ -292,7 +271,7 @@ task:
SCHNORRSIG: yes
ELLSWIFT: yes
test_script:
- ./ci/cirrus.sh
- ./ci/ci.sh
<< : *CAT_LOGS

task:
Expand Down
37 changes: 37 additions & 0 deletions .github/actions/run-in-docker-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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 }}
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
78 changes: 77 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,82 @@ env:
EXAMPLES: 'yes'

jobs:
docker_cache:
name: "Build Docker image"
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
# See: https://github.com/moby/buildkit/issues/3969.
driver-opts: |
network=host
- name: Build container
uses: docker/build-push-action@v4
with:
file: ./ci/linux-debian.Dockerfile
tags: linux-debian-image
cache-from: type=gha
cache-to: type=gha,mode=min

mingw_debian:
name: ${{ matrix.configuration.job_name }}
runs-on: ubuntu-latest
needs: docker_cache

env:
WRAPPER_CMD: 'wine'
WITH_VALGRIND: 'no'
ECDH: 'yes'
RECOVERY: 'yes'
SCHNORRSIG: 'yes'
ELLSWIFT: 'yes'
CTIMETESTS: 'no'

strategy:
fail-fast: false
matrix:
configuration:
- job_name: 'x86_64 (mingw32-w64): Windows (Debian stable, Wine)'
env_vars:
HOST: 'x86_64-w64-mingw32'
- job_name: 'i686 (mingw32-w64): Windows (Debian stable, Wine)'
env_vars:
HOST: 'i686-w64-mingw32'

steps:
- name: Checkout
uses: actions/checkout@v3

- name: CI script
env: ${{ matrix.configuration.env_vars }}
uses: ./.github/actions/run-in-docker-action
with:
dockerfile: ./ci/linux-debian.Dockerfile
tag: linux-debian-image
command: >
git config --global --add safe.directory ${{ github.workspace }} &&
./ci/ci.sh
- run: cat tests.log || true
if: ${{ always() }}
- run: cat noverify_tests.log || true
if: ${{ always() }}
- run: cat exhaustive_tests.log || true
if: ${{ always() }}
- run: cat ctime_tests.log || true
if: ${{ always() }}
- run: cat bench.log || true
if: ${{ always() }}
- run: cat config.log || true
if: ${{ always() }}
- run: cat test_env.log || true
if: ${{ always() }}
- name: CI env
run: env
if: ${{ always() }}

macos-native:
name: "x86_64: macOS Ventura"
# See: https://github.com/actions/runner-images#available-images.
Expand Down Expand Up @@ -80,7 +156,7 @@ jobs:
- name: CI script
env: ${{ matrix.env_vars }}
run: ./ci/cirrus.sh
run: ./ci/ci.sh

- run: cat tests.log || true
if: ${{ always() }}
Expand Down
File renamed without changes.

0 comments on commit 6b9507a

Please sign in to comment.