Skip to content

Centralise duplicated matrix configurations #1281

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/actions/build-test/macos-x86_64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ inputs:
required: true
BOOST_VERSION:
required: true
WARN_AS_ERR:
required: true
BUILD_TYPE:
required: true
SHARED_LIBS_TOGGLE:
Expand Down Expand Up @@ -53,7 +51,6 @@ runs:
GH_TOKEN: ${{ inputs.GH_TOKEN }}
BOOST_VERSION: ${{ inputs.BOOST_VERSION }}
THRIFT_VERSION: ${{ inputs.THRIFT_VERSION }}
WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }}
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
SHARED_LIBS_TOGGLE: ${{ inputs.SHARED_LIBS_TOGGLE }}
OPENSSL_TOGGLE: ${{ inputs.OPENSSL_TOGGLE }}
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/build-test/ubuntu-i386/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ inputs:
required: true
THRIFT_VERSION:
required: true
WARN_AS_ERR:
required: true
BUILD_TYPE:
required: true
SHARED_LIBS_TOGGLE:
Expand Down Expand Up @@ -112,7 +110,6 @@ runs:
GH_TOKEN: ${{ inputs.GH_TOKEN }}
BOOST_VERSION: ${{ inputs.BOOST_VERSION }}
THRIFT_VERSION: ${{ inputs.THRIFT_VERSION }}
WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }}
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
SHARED_LIBS_TOGGLE: ${{ inputs.SHARED_LIBS_TOGGLE }}
OPENSSL_TOGGLE: ${{ inputs.OPENSSL_TOGGLE }}
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/build-test/ubuntu-x86_64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ inputs:
required: true
THRIFT_VERSION:
required: true
WARN_AS_ERR:
required: true
BUILD_TYPE:
required: true
SHARED_LIBS_TOGGLE:
Expand Down Expand Up @@ -74,7 +72,6 @@ runs:
GH_TOKEN: ${{ inputs.GH_TOKEN }}
BOOST_VERSION: ${{ inputs.BOOST_VERSION }}
THRIFT_VERSION: ${{ inputs.THRIFT_VERSION }}
WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }}
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
SHARED_LIBS_TOGGLE: ${{ inputs.SHARED_LIBS_TOGGLE }}
OPENSSL_TOGGLE: ${{ inputs.OPENSSL_TOGGLE }}
Expand Down
5 changes: 1 addition & 4 deletions .github/actions/build-test/unix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ inputs:
required: true
THRIFT_VERSION:
required: true
WARN_AS_ERR:
required: true
BUILD_TYPE:
required: true
SHARED_LIBS_TOGGLE:
Expand Down Expand Up @@ -45,11 +43,10 @@ runs:
env:
BUILD_DIR: build
INSTALL: ON
WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }}
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
shell: ${{ env.shell }}
run: |
./scripts/build-unix.sh \
-DCMAKE_BUILD_TYPE=${{ inputs.BUILD_TYPE }} \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/destination \
-DBUILD_SHARED_LIBS=${{ inputs.SHARED_LIBS_TOGGLE }} \
-DWITH_OPENSSL=${{ inputs.OPENSSL_TOGGLE }} \
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/coverage-report/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ runs:
env:
BUILD_DIR: build
COVERAGE: ON
BUILD_TYPE: Debug
shell: ${{ env.shell }}
run: |
./scripts/build-unix.sh \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=ON \
-DWITH_OPENSSL=ON \
-DBUILD_TESTS=ON \
Expand Down
119 changes: 34 additions & 85 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,35 +115,26 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}

shared-matrix:
uses: ./.github/workflows/get-shared-matrix.yml

Ubuntu-i386:
needs: get-refs
needs:
- get-refs
- shared-matrix
strategy:
fail-fast: false
matrix:
build_type:
- type: Debug
warn_as_err: ON
- type: Release
warn_as_err: OFF

shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared

with_openssl:
- toggle: OFF
name: 'noSSL'
- toggle: ON
name: 'SSL'
build_type: ${{ fromJSON(needs.shared-matrix.outputs.build-type) }}
shared_libs: ${{ fromJSON(needs.shared-matrix.outputs.shared-libs) }}
with_openssl: ${{ fromJSON(needs.shared-matrix.outputs.openssl) }}

runs-on: ubuntu-latest
container:
image: i386/ubuntu
options: --privileged

name: ubuntu-i386-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
name: ubuntu-i386-(${{ matrix.build_type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})

steps:
# Deliberately uses an old version because i386 is stuck on an outdated version of Javascript
Expand All @@ -158,8 +149,7 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BOOST_VERSION: ${{ env.boost_version }}
THRIFT_VERSION: ${{ env.thrift_version }}
WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }}
BUILD_TYPE: ${{ matrix.build_type.type }}
BUILD_TYPE: ${{ matrix.build_type }}
SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }}
OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }}
RUN_TESTS: ${{ env.run_tests }}
Expand All @@ -170,32 +160,19 @@ jobs:


Ubuntu-x86_64:
needs: get-refs
needs:
- get-refs
- shared-matrix
strategy:
fail-fast: false
matrix:

build_type:
- type: Debug
warn_as_err: ON
- type: Release
warn_as_err: OFF

shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared

with_openssl:
- toggle: OFF
name: noSSL
- toggle: ON
name: SSL
build_type: ${{ fromJSON(needs.shared-matrix.outputs.build-type) }}
shared_libs: ${{ fromJSON(needs.shared-matrix.outputs.shared-libs) }}
with_openssl: ${{ fromJSON(needs.shared-matrix.outputs.openssl) }}

runs-on: ubuntu-latest

name: ubuntu-x64-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
name: ubuntu-x64-(${{ matrix.build_type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
steps:

- uses: actions/checkout@v4
Expand All @@ -208,8 +185,7 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BOOST_VERSION: ${{ env.boost_version }}
THRIFT_VERSION: ${{ env.thrift_version }}
WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }}
BUILD_TYPE: ${{ matrix.build_type.type }}
BUILD_TYPE: ${{ matrix.build_type }}
SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }}
OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }}
RUN_TESTS: ${{ env.run_tests }}
Expand All @@ -219,30 +195,16 @@ jobs:
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}

Windows:
needs: get-refs
needs:
- get-refs
- shared-matrix
strategy:
fail-fast: false
matrix:
arch:
- cmake: Win32
choco_options: '--forceX86 --x86 --version 1.1.1.2100 -y'
address_model: 32
- cmake: x64
choco_options: ''
address_model: 64
build_type:
- Debug
- Release
shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared
with_openssl:
- toggle: OFF
name: 'noSSL'
- toggle: ON
name: 'SSL'
arch: ${{ fromJSON(needs.shared-matrix.outputs.windows-arch) }}
build_type: ${{ fromJSON(needs.shared-matrix.outputs.build-type) }}
shared_libs: ${{ fromJSON(needs.shared-matrix.outputs.shared-libs) }}
with_openssl: ${{ fromJSON(needs.shared-matrix.outputs.openssl) }}

runs-on: 'windows-latest'
env:
Expand Down Expand Up @@ -278,31 +240,19 @@ jobs:
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}

macOS-x86_64:
needs: get-refs
needs:
- get-refs
- shared-matrix
strategy:
fail-fast: false
matrix:
build_type:
- type: Debug
warn_as_err: ON
- type: Release
warn_as_err: OFF

shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared

with_openssl:
- toggle: OFF
name: 'noSSL'
- toggle: ON
name: 'SSL'
build_type: ${{ fromJSON(needs.shared-matrix.outputs.build-type) }}
shared_libs: ${{ fromJSON(needs.shared-matrix.outputs.shared-libs) }}
with_openssl: ${{ fromJSON(needs.shared-matrix.outputs.openssl) }}

runs-on: macos-latest

name: macOS-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
name: macOS-(${{ matrix.build_type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
env:
OPENSSL_ROOT_DIR: /usr/local/opt/openssl/

Expand All @@ -316,8 +266,7 @@ jobs:
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BOOST_VERSION: ${{ env.boost_version }}
WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }}
BUILD_TYPE: ${{ matrix.build_type.type }}
BUILD_TYPE: ${{ matrix.build_type }}
SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }}
OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }}
RUN_TESTS: ${{ env.run_tests }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/get-shared-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Get common matrix configuration

on:
workflow_call:
outputs:
build-type:
value: ${{ jobs.get-configurations.outputs.build-type }}
shared-libs:
value: ${{ jobs.get-configurations.outputs.shared-libs }}
openssl:
value: ${{ jobs.get-configurations.outputs.openssl }}
windows-arch:
value: ${{ jobs.get-configurations.outputs.windows-arch }}

jobs:
get-configurations:
runs-on: ubuntu-latest
outputs:
build-type: "['Debug', 'Release']"
shared-libs: "[{'toggle': 'OFF', 'name': 'Static'}, {'toggle': 'ON', 'name': 'Shared'}]"
openssl: "[{'toggle': 'OFF', 'name': 'noSSL'}, {'toggle': 'ON', 'name': 'SSL'}]"
windows-arch: "[{'cmake': 'Win32', 'choco_options': '--forceX86 --x86 --version 1.1.1.2100 -y', 'address_model': '32'}, {'cmake': 'x64', 'choco_options': '', 'address_model': '64'}]"
steps:
- run: exit 0
30 changes: 9 additions & 21 deletions .github/workflows/nightly-macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,26 @@ on:
- cron: '0 0 * * *'

jobs:
shared-matrix:
uses: ./.github/workflows/get-shared-matrix.yml

nightly-macOS-x86_64:
needs: shared-matrix
strategy:
fail-fast: false
matrix:
boost:
- version: 1.71.0
- version: 1.76.0

build_type:
- type: Debug
warn_as_err: ON
- type: Release
warn_as_err: OFF

shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared

with_openssl:
- toggle: OFF
name: 'noSSL'
- toggle: ON
name: 'SSL'
build_type: ${{ fromJSON(needs.shared-matrix.outputs.build-type) }}
shared_libs: ${{ fromJSON(needs.shared-matrix.outputs.shared-libs) }}
with_openssl: ${{ fromJSON(needs.shared-matrix.outputs.openssl) }}

runs-on: macos-latest

name: >-
macOS-x86_64
(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }}, ${{matrix.boost.version}})
(${{ matrix.build_type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }}, ${{matrix.boost.version}})

env:
OPENSSL_ROOT_DIR: /usr/local/opt/openssl/
Expand All @@ -53,8 +42,7 @@ jobs:
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BOOST_VERSION: ${{ matrix.boost.version }}
WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }}
BUILD_TYPE: ${{ matrix.build_type.type }}
BUILD_TYPE: ${{ matrix.build_type }}
SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }}
OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }}
RUN_TESTS: ${{ inputs.run_tests || github.event_name == 'schedule' }}
Expand Down
Loading
Loading