Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

GHA: Allow setting defines, variant, and linkage via matrix #262

Merged
merged 1 commit into from
Feb 11, 2025
Merged
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
26 changes: 19 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,27 +226,28 @@ jobs:

- name: Setup multiarch
if: matrix.multiarch
run: ci/github/setup_bdde.sh
env:
BDDE_DISTRO: ${{matrix.distro}}
BDDE_EDITION: ${{matrix.edition}}
BDDE_ARCH: ${{matrix.arch}}
run: ci/github/setup_bdde.sh

- name: Setup Boost
run: source ci/github/install.sh
env:
B2_ADDRESS_MODEL: ${{matrix.address-model}}
B2_COMPILER: ${{matrix.compiler}}
B2_CXXSTD: ${{matrix.cxxstd}}
B2_SANITIZE: ${{matrix.sanitize}}
B2_STDLIB: ${{matrix.stdlib}}
# Optional. Variables set here (to non-empty) will override the top-level environment variables
B2_DEFINES: ${{matrix.defines}}
B2_VARIANT: ${{matrix.variant}}
B2_LINK: ${{matrix.link}}
# More entries can be added in the same way, see the B2_ARGS assignment in ci/enforce.sh for the possible keys.
# B2_DEFINES: ${{matrix.defines}}
# Variables set here (to non-empty) will override the top-level environment variables, e.g.
# B2_VARIANT: ${{matrix.variant}}
# Set the (B2) target(s) to build, defaults to the test folder of the current library
# Can alternatively be done like this in the build step or in the build command of the build step, e.g. `run: B2_TARGETS=libs/$SELF/doc ci/build.sh`
# B2_TARGETS: libs/foo/test//bar
run: source ci/github/install.sh

- name: Setup coverage collection
if: matrix.coverage
Expand Down Expand Up @@ -321,6 +322,9 @@ jobs:
B2_TOOLSET: ${{matrix.toolset}}
B2_CXXSTD: ${{matrix.cxxstd}}
B2_ADDRESS_MODEL: ${{matrix.addrmd}}
B2_DEFINES: ${{matrix.defines}}
B2_VARIANT: ${{matrix.variant}}
B2_LINK: ${{matrix.link}}

- name: Collect coverage
shell: powershell
Expand All @@ -330,6 +334,9 @@ jobs:
B2_TOOLSET: ${{matrix.toolset}}
B2_CXXSTD: ${{matrix.cxxstd}}
B2_ADDRESS_MODEL: ${{matrix.addrmd}}
B2_DEFINES: ${{matrix.defines}}
B2_VARIANT: ${{matrix.variant}}
B2_LINK: ${{matrix.link}}

- name: Upload coverage
if: matrix.coverage
Expand Down Expand Up @@ -378,12 +385,15 @@ jobs:
rm -rf boost-ci-cloned

- name: Setup Boost
run: ci/github/install.sh
env:
B2_COMPILER: ${{matrix.compiler}}
B2_CXXSTD: ${{matrix.cxxstd}}
B2_SANITIZE: ${{matrix.sanitize}}
B2_STDLIB: ${{matrix.stdlib}}
run: ci/github/install.sh
B2_DEFINES: ${{matrix.defines}}
B2_VARIANT: ${{matrix.variant}}
B2_LINK: ${{matrix.link}}

- name: Run tests
run: ci/build.sh
Expand Down Expand Up @@ -422,14 +432,16 @@ jobs:
repository: boostorg/boost-ci
ref: master
path: boost-ci-cloned

- name: Get CI scripts folder
run: |
# Copy ci folder if not testing Boost.CI
[[ "$GITHUB_REPOSITORY" =~ "boost-ci" ]] || cp -r boost-ci-cloned/ci .
rm -rf boost-ci-cloned

- name: Setup Boost
env: {B2_DONT_BOOTSTRAP: 1}
run: source ci/github/install.sh
env: {B2_DONT_BOOTSTRAP: 1}

- name: Run CMake tests
run: |
Expand Down
Loading