Skip to content
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
33 changes: 33 additions & 0 deletions .ci/build-kit/scripts/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

TRAILBOOK_everest_IS_RELEASE=${TRAILBOOK_everest_IS_RELEASE:-"OFF"}
TRAILBOOK_everest_INSTANCE_NAME=${TRAILBOOK_everest_INSTANCE_NAME:-"nightly"}
TRAILBOOK_everest_OVERWRITE_EXISTING_INSTANCE=${TRAILBOOK_everest_OVERWRITE_EXISTING_INSTANCE:-"OFF"}

mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts

cmake \
-B "$EXT_MOUNT/build" \
-S "$EXT_MOUNT/source" \
-G Ninja \
-D EVC_ENABLE_CCACHE=ON \
-D EVEREST_ENABLE_COMPILE_WARNINGS=ON \
-D EVEREST_BUILD_DOCS=ON \
-D TRAILBOOK_everest_DOWNLOAD_ALL_VERSIONS=ON \
-D TRAILBOOK_everest_IS_RELEASE=$TRAILBOOK_everest_IS_RELEASE \
-D TRAILBOOK_everest_INSTANCE_NAME="$TRAILBOOK_everest_INSTANCE_NAME" \
-D TRAILBOOK_everest_OVERWRITE_EXISTING_INSTANCE=$TRAILBOOK_everest_OVERWRITE_EXISTING_INSTANCE
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Configuring failed with return code $retVal"
exit $retVal
fi

ninja -C "$EXT_MOUNT/build" trailbook_everest
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Compiling failed with return code $retVal"
exit $retVal
fi
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Bazel Build
name: Bazel Build And Test
run-name: ${{ github.actor }} is building with bazel
on:
pull_request: {}
merge_group: {}
workflow_call:
inputs:
runner:
description: 'Which runner to use'
required: false
default: 'ubuntu-24.04'
type: string
jobs:
bazel-build-and-test:
runs-on: ubuntu-22.04
runs-on: ${{ inputs.runner }}
steps:
- run: echo branch name is ${{ github.ref }}
- name: Checkout
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/job_build-build-kit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build the build-kit

on:
workflow_call:
inputs:
runner:
description: 'Which runner to use'
required: false
default: 'ubuntu-24.04'
type: string
build_kit_docker_directory:
description: 'Directory in the repository where the build kit Dockerfile is located'
required: false
default: '.ci/build-kit/docker'
type: string
base_image_tag_everest_ci:
description: 'The tag of the everest-ci base image to use for building the build-kit'
required: true
type: string
outputs:
build_kit_artifact_name:
description: 'The name of the build-kit artifact'
value: ${{ jobs.build-build-kit.outputs.build_kit_artifact_name }}
build_kit_image_tag:
description: 'The tag of the built build-kit image'
value: ${{ jobs.build-build-kit.outputs.build_kit_image_tag }}

jobs:
build-build-kit:
name: Build the build-kit
runs-on: ${{ inputs.runner }}
env:
BUILD_KIT_ARTIFACT_NAME: build-kit
BUILD_KIT_IMAGE_NAME: local/build-kit-${{ github.event.repository.name }}
BUILD_ARGS: |
BASE_IMAGE_TAG=${{ inputs.base_image_tag_everest_ci }}
outputs:
build_kit_image_tag: ${{ steps.set-outputs.outputs.tag }}
build_kit_artifact_name: ${{ env.BUILD_KIT_ARTIFACT_NAME }}
steps:
- name: Checkout Dockerfile
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
path: source
ref: ${{ github.ref }}
token: ${{ github.token}}
fetch-depth: 0
- name: Docker Meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.BUILD_KIT_IMAGE_NAME }}
sep-tags: ","
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v6
with:
context: source/${{ inputs.build_kit_docker_directory }}
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: ${{ env.BUILD_ARGS }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=docker,dest=build-kit.tar
- name: Upload build-kit image
uses: actions/upload-artifact@v4
with:
name: ${{ env.BUILD_KIT_ARTIFACT_NAME }}
path: build-kit.tar
- name: Set output tag
id: set-outputs
shell: python3 {0}
run: |
import os
tags = "${{ steps.meta.outputs.tags }}".split(",")
if len(tags) == 0:
print("No tags found!❌")
exit(1)
tag = tags[0]
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"tag={tag}\n")
print(f"Set tag={tag}")
245 changes: 245 additions & 0 deletions .github/workflows/job_build-cmake-gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
name: Build with CMake and GCC

on:
workflow_call:
inputs:
runner:
description: 'Which runner to use'
required: false
default: 'ubuntu-24.04'
type: string
ref_everest_ci:
description: 'The reference of the everest-ci repository to checkout'
required: true
type: string
is_fork:
description: 'Whether the current repository is a fork'
required: true
type: string
build-kit-artifact-name:
description: 'The name of the build-kit artifact to download'
required: true
type: string
build_kit_image_tag:
description: 'The tag of the build-kit image to use for building the project'
required: true
type: string
build_kit_scripts_directory:
description: 'Directory in the repository where the build kit scripts are located'
required: false
default: '.ci/build-kit/scripts'
type: string
ctest_report_path:
description: 'The path to the ctest report, relative to the github workspace'
required: false
default: 'build/Testing/Temporary/LastTest.log'
type: string
coverage_report_path:
description: 'The path to the coverage report, relative to the github workspace'
required: false
default: 'build/gcovr-coverage'
type: string
coverage_xml_path:
description: 'The path to the coverage xml, relative to the github workspace'
required: false
default: 'build/coverage.xml'
type: string
artifact_deploy_target_repo:
description: 'Repository to deploy artifacts to'
required: true
type: string
wheels_path:
description: 'The path to the wheels directory, relative to the github workspace'
required: false
default: 'wheels'
type: string
secrets:
coverage_deploy_token:
description: 'The token to use to deploy the coverage report'
required: true
SA_GITHUB_SSH_KEY:
description: 'The ssh key to use for git operations'
required: false
outputs:
ctest_report_artifact_name:
description: 'The name of the ctest report artifact uploaded'
value: ${{ jobs.build-cmake-gcc.outputs.ctest_report_artifact_name }}
coverage_report_artifact_name:
description: 'The name of the coverage report artifact uploaded'
value: ${{ jobs.build-cmake-gcc.outputs.coverage_report_artifact_name }}
coverage_xml_artifact_name:
description: 'The name of the coverage xml artifact uploaded'
value: ${{ jobs.build-cmake-gcc.outputs.coverage_xml_artifact_name }}
dist_artifact_name:
description: 'The name of the dist artifact uploaded'
value: ${{ jobs.build-cmake-gcc.outputs.dist_artifact_name }}
wheels_artifact_name:
description: 'The name of the wheels artifact uploaded'
value: ${{ jobs.build-cmake-gcc.outputs.wheels_artifact_name }}

jobs:
build-cmake-gcc:
name: Build with CMake and GCC, Unit Tests and Install
runs-on: ${{ inputs.runner }}
env:
CTEST_REPORT_ARTIFACT_NAME: ctest-report
COVERAGE_REPORT_ARTIFACT_NAME: coverage-report
COVERAGE_XML_ARTIFACT_NAME: coverage-xml
DIST_ARTIFACT_NAME: dist
WHEELS_ARTIFACT_NAME: wheels
BUILD_KIT_IMAGE: ${{ inputs.build_kit_image_tag }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
outputs:
ctest_report_artifact_name: ${{ env.CTEST_REPORT_ARTIFACT_NAME }}
coverage_report_artifact_name: ${{ env.COVERAGE_REPORT_ARTIFACT_NAME }}
coverage_xml_artifact_name: ${{ env.COVERAGE_XML_ARTIFACT_NAME }}
dist_artifact_name: ${{ env.DIST_ARTIFACT_NAME }}
wheels_artifact_name: ${{ env.WHEELS_ARTIFACT_NAME }}
steps:
- name: Setup SSH Agent, optional with SSH key
env:
SSH_KEY: ${{ secrets.SA_GITHUB_SSH_KEY }}
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
if [ -z "${{ env.SSH_KEY }}" ]; then
echo "No SSH key provided, skipping SSH key setup"
exit 0
fi
mkdir -p ~/.ssh
echo "${{ env.SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
# Check if github.com is already in known_hosts, if not, add it
if ! grep -q "^github.com " ~/.ssh/known_hosts; then
ssh-keyscan github.com >> ~/.ssh/known_hosts
fi
ssh-add ~/.ssh/id_ed25519
- name: Checkout local github actions
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/everest-ci
ref: ${{ inputs.ref_everest_ci }}
path: everest-ci
- name: Format branch name for cache key
run: |
BRANCH_NAME_FOR_CACHE="${GITHUB_REF_NAME//-/_}"
echo "branch_name_for_cache=${BRANCH_NAME_FOR_CACHE}" >> "$GITHUB_ENV"
- name: Setup cache
uses: actions/cache@v4
with:
path: cache
key: compile-${{ env.branch_name_for_cache }}-${{ github.sha }}
restore-keys: |
compile-${{ env.branch_name_for_cache }}-
compile-
- name: Checkout repository
uses: actions/checkout@v4
with:
path: source
- name: Setup run scripts
run: |
mkdir scripts
rsync -a source/${{ inputs.build_kit_scripts_directory }}/ scripts
- name: Download build-kit image
uses: actions/download-artifact@v5
with:
name: ${{ inputs.build-kit-artifact-name }}
- name: Load build-kit image
run: |
docker load -i build-kit.tar
docker image tag ${{ env.BUILD_KIT_IMAGE }} build-kit
- name: Compile
run: |
docker run \
--mount type=bind,source=$SSH_AUTH_SOCK,target=/ssh-agent \
--env SSH_AUTH_SOCK=/ssh-agent \
--volume "${{ github.workspace }}:/ext" \
--name compile-container \
build-kit run-script compile
- name: Run unit tests
id: run_unit_tests
run: |
docker run \
--mount type=bind,source=$SSH_AUTH_SOCK,target=/ssh-agent \
--env SSH_AUTH_SOCK=/ssh-agent \
--volume "${{ github.workspace }}:/ext" \
--name unit-test-container \
build-kit run-script run_unit_tests
- name: Archive test results
if: ${{ always() && (steps.run_unit_tests.outcome == 'success' || steps.run_unit_tests.outcome == 'failure') }}
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.CTEST_REPORT_ARTIFACT_NAME }}
path: ${{ inputs.ctest_report_path }}
# - name: Run coverage
# id: run_coverage
# run: |
# docker run \
# --mount type=bind,source=$SSH_AUTH_SOCK,target=/ssh-agent \
# --env SSH_AUTH_SOCK=/ssh-agent \
# --volume "${{ github.workspace }}:/ext" \
# --name coverage-container \
# build-kit run-script run_coverage
# - name: Archive coverage report
# if: ${{ always() && (steps.run_coverage.outcome == 'success' || steps.run_coverage.outcome == 'failure') }}
# uses: actions/upload-artifact@v4
# with:
# if-no-files-found: error
# name: ${{ env.COVERAGE_REPORT_ARTIFACT_NAME }}
# path: ${{ inputs.coverage_report_path }}
# - name: Archive coverage xml
# if: ${{ always() && (steps.run_coverage.outcome == 'success' || steps.run_coverage.outcome == 'failure') }}
# uses: actions/upload-artifact@v4
# with:
# if-no-files-found: error
# name: ${{ env.COVERAGE_XML_ARTIFACT_NAME }}
# path: ${{ inputs.coverage_xml_path}}
# - name: Deploy html coverage report
# id: deploy_coverage_report
# if: ${{ always() && ( steps.run_coverage.outcome == 'success' || steps.run_coverage.outcome == 'failure' ) && inputs.is_fork == 'false' }}
# uses: ./everest-ci/github-actions/deploy-ci-artifact
# with:
# target_repo: ${{ inputs.artifact_deploy_target_repo }}
# github_token: ${{ secrets.coverage_deploy_token }}
# artifact_name: coverage-report
# artifact_directory: ${{ inputs.coverage_report_path }}
# - name: Write summary coverage
# if: ${{ always() && (steps.run_coverage.outcome == 'success' || steps.run_coverage.outcome == 'failure') }}
# run: |
# echo "Coverage report deployed to: [everest.github.io](https://everest.github.io/${{ steps.deploy_coverage_report.outputs.deployed_path }})" >> $GITHUB_STEP_SUMMARY
- name: Create dist
id: create_dist
run: |
docker run \
--mount type=bind,source=$SSH_AUTH_SOCK,target=/ssh-agent \
--env SSH_AUTH_SOCK=/ssh-agent \
--volume "${{ github.workspace }}:/ext" \
--name dist-container \
build-kit run-script install
- name: Tar dist dir and keep permissions
if: ${{ always() && (steps.create_dist.outcome == 'success' || steps.create_dist.outcome == 'failure') }}
run: |
tar -czf dist.tar.gz dist
- name: Upload dist artifact
if: ${{ always() && (steps.create_dist.outcome == 'success' || steps.create_dist.outcome == 'failure') }}
uses: actions/[email protected]
with:
if-no-files-found: error
path: dist.tar.gz
name: ${{ env.DIST_ARTIFACT_NAME }}
- name: Create wheels
id: create_wheels
run: |
docker run \
--mount type=bind,source=$SSH_AUTH_SOCK,target=/ssh-agent \
--env SSH_AUTH_SOCK=/ssh-agent \
--volume "${{ github.workspace }}:/ext" \
--name wheels-container \
build-kit run-script install_wheels
- name: Upload wheels artifact
if: ${{ always() && (steps.create_wheels.outcome == 'success' || steps.create_wheels.outcome == 'failure') }}
uses: actions/[email protected]
with:
if-no-files-found: error
path: ${{ inputs.wheels_path }}
name: ${{ env.WHEELS_ARTIFACT_NAME }}
Loading
Loading