Skip to content

Commit

Permalink
improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Aug 10, 2023
1 parent 38e67e7 commit cf84189
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 39 deletions.
76 changes: 38 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,45 +44,45 @@ jobs:
outputs:
env_vars: ${{ steps.result.outputs.env_vars }}
steps:
- id: result
run: |
echo $(echo '${{ toJSON(env) }}' | jq -r 'to_entries | .[] | "\(.key)=\"\(.value)\""' | paste -sd " ") >> $GITHUB_OUTPUT
echo $(echo '${{ toJSON(env) }}' | jq -r 'to_entries | .[] | "\(.key)=\"\(.value)\""' | paste -sd " ")
- name: Create environment variables output
id: result
run: echo "env_vars=$(echo '${{ toJSON(env) }}' | jq -r 'to_entries | .[] | "\(.key)=\"\(.value)\""' | paste -sd ' ')" >> $GITHUB_OUTPUT

# docker_wine_cache:
# name: 'Build MinGW/MSVC Debian image'
# runs-on: ubuntu-latest
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2

# - name: Build container
# uses: docker/build-push-action@v4
# with:
# file: ./ci/linux-debian-wine.Dockerfile
# tags: ci-image
# push: false
# load: false
# cache-from: type=gha
# cache-to: type=gha,mode=min

# mingw_debian:
# name: ${{ matrix.configuration.job_name }}
# needs: docker_wine_cache
# 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'
# uses: ./.github/workflows/run-in-docker.yml
# with:
# dockerfile: ./ci/linux-debian-wine.Dockerfile
# tag: ci-image
# job_env_vars: 'WRAPPER_CMD=wine WITH_VALGRIND=no ECDH=yes RECOVERY=yes SCHNORRSIG=yes CTIMETESTS=no'
# matrix_env_vars: ${{ matrix.configuration.env_vars }}
docker_wine_cache:
name: 'Build MinGW/MSVC Debian image'
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build container
uses: docker/build-push-action@v4
with:
file: ./ci/linux-debian-wine.Dockerfile
tags: ci-image
push: false
load: false
cache-from: type=gha
cache-to: type=gha,mode=min

mingw_debian:
name: ${{ matrix.configuration.job_name }}
needs: [env_vars, docker_wine_cache]
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'
uses: ./.github/workflows/run-in-docker.yml
with:
dockerfile: ./ci/linux-debian-wine.Dockerfile
tag: ci-image
workflow_env_vars: ${{ needs.env_vars.outputs.env_vars }}
job_env_vars: 'WRAPPER_CMD=wine WITH_VALGRIND=no ECDH=yes RECOVERY=yes SCHNORRSIG=yes CTIMETESTS=no'
matrix_env_vars: ${{ matrix.configuration.env_vars }}

# msvc_debian:
# name: ${{ matrix.configuration.job_name }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/run-in-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
default: 'ci-image'
required: false
type: string
workflow_env_vars:
description: 'Environment variables provided by a caller workflow'
required: false
type: string
job_env_vars:
description: 'Environment variables provided by a job'
required: false
Expand All @@ -28,7 +32,7 @@ jobs:

- name: Set environment variables
run: |
read -r -a vars <<< "${{ inputs.job_env_vars }} ${{ inputs.matrix_env_vars }}"
read -r -a vars <<< "${{ inputs.workflow_env_vars }} ${{ inputs.job_env_vars }} ${{ inputs.matrix_env_vars }}"
for var in "${vars[@]}"; do
echo "$var" >> "$GITHUB_ENV"
done
Expand Down

0 comments on commit cf84189

Please sign in to comment.