Skip to content

#2482: lib: update bundled libs cmake version requirements to avoid failure with CMake 4.0 #296

#2482: lib: update bundled libs cmake version requirements to avoid failure with CMake 4.0

#2482: lib: update bundled libs cmake version requirements to avoid failure with CMake 4.0 #296

name: CI
on:
push:
branches:
- develop
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.list-targets.outputs.targets }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: List targets
id: list-targets
uses: docker/bake-action/subaction/list-targets@v6
with:
target: vt-build-all
bake:
runs-on: ubuntu-latest
needs:
- prepare
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.prepare.outputs.targets) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
id: setup-buildx
uses: docker/setup-buildx-action@v3
- uses: actions/cache@v4
id: ccache-archive
with:
path: ccache-archive
key: ${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ matrix.target }}-${{ github.ref }}
${{ matrix.target }}-
- name: Inject ccache
uses: reproducible-containers/buildkit-cache-dance@v3
with:
builder: ${{ steps.setup-buildx.outputs.name }}
cache-map: |
{
"ccache-archive": {
"target": "/build/ccache",
"id": "${{ matrix.target }}"
}
}
skip-extraction: ${{ steps.ccache-archive.outputs.cache-hit }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build
uses: docker/bake-action@v6
id: build-image
with:
source: .
targets: ${{ matrix.target }}
files: docker-bake.hcl
push: ${{ github.ref == 'refs/heads/develop' }}
set: |
*.args.CACHE_ID=${{ matrix.target }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
- name: Retrieve build artifacts
run: |
# We rely on the persistence of data on cache mounts with identical IDs and builders.
# This allows us to copy build artifacts from the "bake" step and use the Codecov action within the GitHub environment.
echo "
FROM ubuntu:latest
RUN --mount=type=cache,id=BUILD-${{ matrix.target }},target=/build/vt \
mkdir -p /vt \
&& cp -p -R /build/vt/. /vt/ || true
" >> tmp_dockerfile
docker buildx build --builder ${{ steps.setup-buildx.outputs.name }} -f tmp_dockerfile --output type=local,dest=build .
- name: Generate comment
if: github.event_name == 'pull_request'
id: generate_comment
run: |
comment_content=$(
./scripts/generate_comment_body.sh \
"build/vt/compilation_errors_warnings.out" \
"build/vt/cmake-output.log" \
"${{ matrix.target }}" \
"${{ steps.build-image.outcome }}"
)
echo "comment_content<<EOF" >>"$GITHUB_OUTPUT"
echo "$comment_content" >>"$GITHUB_OUTPUT"
echo "EOF" >>"$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: DARMA-tasking/comment-on-pr@master
if: github.event_name == 'pull_request'
with:
repo_owner: ${{ github.event.repository.owner.login }}
repo_name: ${{ github.event.repository.name }}
pr_number: ${{ github.event.pull_request.number }}
comment_title: ${{ matrix.target }}
comment_content: ${{ steps.generate_comment.outputs.comment_content }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage
if: ${{ matrix.target == 'vt-build-amd64-ubuntu-22-04-gcc-11-cpp' }}
uses: codecov/codecov-action@v5
with:
files: build/vt/coverage.info
token: ${{ secrets.CODECOV_TOKEN }}