Skip to content

Commit 7ed8dc7

Browse files
committed
ci for new doc
Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de>
1 parent bbb8f17 commit 7ed8dc7

22 files changed

Lines changed: 1207 additions & 122 deletions
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
TRAILBOOK_everest_IS_RELEASE=${TRAILBOOK_everest_IS_RELEASE:-"OFF"}
4+
TRAILBOOK_everest_INSTANCE_NAME=${TRAILBOOK_everest_INSTANCE_NAME:-"nightly"}
5+
TRAILBOOK_everest_OVERWRITE_EXISTING_INSTANCE=${TRAILBOOK_everest_OVERWRITE_EXISTING_INSTANCE:-"OFF"}
6+
7+
mkdir -p ~/.ssh
8+
ssh-keyscan github.com >> ~/.ssh/known_hosts
9+
chmod 600 ~/.ssh/known_hosts
10+
11+
cmake \
12+
-B "$EXT_MOUNT/build" \
13+
-S "$EXT_MOUNT/source" \
14+
-G Ninja \
15+
-D EVC_ENABLE_CCACHE=ON \
16+
-D EVEREST_ENABLE_COMPILE_WARNINGS=ON \
17+
-D EVEREST_BUILD_DOCS=ON \
18+
-D TRAILBOOK_everest_DOWNLOAD_ALL_VERSIONS=ON \
19+
-D TRAILBOOK_everest_IS_RELEASE=$TRAILBOOK_everest_IS_RELEASE \
20+
-D TRAILBOOK_everest_INSTANCE_NAME="$TRAILBOOK_everest_INSTANCE_NAME" \
21+
-D TRAILBOOK_everest_OVERWRITE_EXISTING_INSTANCE=$TRAILBOOK_everest_OVERWRITE_EXISTING_INSTANCE \
22+
-D EVEREST_DOCS_REPO_URL=$EVEREST_DOCS_REPO_URL
23+
retVal=$?
24+
if [ $retVal -ne 0 ]; then
25+
echo "Configuring failed with return code $retVal"
26+
exit $retVal
27+
fi
28+
29+
ninja -C "$EXT_MOUNT/build" trailbook_everest
30+
retVal=$?
31+
if [ $retVal -ne 0 ]; then
32+
echo "Compiling failed with return code $retVal"
33+
exit $retVal
34+
fi
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
DEPLOYED_DOCS_REPO="$EXT_MOUNT/build/docs/deployed_docs_repo"
4+
5+
mkdir -p ~/.ssh
6+
ssh-keyscan github.com >> ~/.ssh/known_hosts
7+
chmod 600 ~/.ssh/known_hosts
8+
9+
git -C $DEPLOYED_DOCS_REPO config user.email "compiler@pionix.de"
10+
git -C $DEPLOYED_DOCS_REPO config user.name "Pionix Github Service Account"
11+
12+
git -C $DEPLOYED_DOCS_REPO add .
13+
retVal=$?
14+
if [ $retVal -ne 0 ]; then
15+
echo "Staging changes failed with return code $retVal"
16+
exit $retVal
17+
fi
18+
19+
git -C $DEPLOYED_DOCS_REPO commit -m "Update nightly documentation from commit $GITHUB_SHA"
20+
retVal=$?
21+
if [ $retVal -ne 0 ]; then
22+
echo "Committing changes failed with return code $retVal"
23+
exit $retVal
24+
fi
25+
26+
git -C "$DEPLOYED_DOCS_REPO" push
27+
retVal=$?
28+
if [ $retVal -ne 0 ]; then
29+
echo "Pushing changes failed with return code $retVal"
30+
exit $retVal
31+
fi

.github/workflows/bazel_build_and_test.yaml renamed to .github/workflows/job_bazel-build-test.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
name: Bazel Build
1+
name: Bazel Build And Test
22
run-name: ${{ github.actor }} is building with bazel
33
on:
4-
pull_request: {}
5-
merge_group: {}
4+
workflow_call:
5+
inputs:
6+
runner:
7+
description: 'Which runner to use'
8+
required: false
9+
default: 'ubuntu-24.04'
10+
type: string
611
jobs:
712
bazel-build-and-test:
8-
runs-on: ubuntu-22.04
13+
runs-on: ${{ inputs.runner }}
914
steps:
1015
- run: echo branch name is ${{ github.ref }}
1116
- name: Checkout
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Build the build-kit
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
description: 'Which runner to use'
8+
required: false
9+
default: 'ubuntu-24.04'
10+
type: string
11+
build_kit_docker_directory:
12+
description: 'Directory in the repository where the build kit Dockerfile is located'
13+
required: false
14+
default: '.ci/build-kit/docker'
15+
type: string
16+
base_image_tag_everest_ci:
17+
description: 'The tag of the everest-ci base image to use for building the build-kit'
18+
required: true
19+
type: string
20+
outputs:
21+
build_kit_artifact_name:
22+
description: 'The name of the build-kit artifact'
23+
value: ${{ jobs.build-build-kit.outputs.build_kit_artifact_name }}
24+
build_kit_image_tag:
25+
description: 'The tag of the built build-kit image'
26+
value: ${{ jobs.build-build-kit.outputs.build_kit_image_tag }}
27+
28+
jobs:
29+
build-build-kit:
30+
name: Build the build-kit
31+
runs-on: ${{ inputs.runner }}
32+
env:
33+
BUILD_KIT_ARTIFACT_NAME: build-kit
34+
BUILD_KIT_IMAGE_NAME: local/build-kit-${{ github.event.repository.name }}
35+
BUILD_ARGS: |
36+
BASE_IMAGE_TAG=${{ inputs.base_image_tag_everest_ci }}
37+
outputs:
38+
build_kit_image_tag: ${{ steps.set-outputs.outputs.tag }}
39+
build_kit_artifact_name: ${{ env.BUILD_KIT_ARTIFACT_NAME }}
40+
steps:
41+
- name: Checkout Dockerfile
42+
uses: actions/checkout@v4
43+
with:
44+
repository: ${{ github.repository }}
45+
path: source
46+
ref: ${{ github.ref }}
47+
token: ${{ github.token}}
48+
fetch-depth: 0
49+
- name: Docker Meta
50+
id: meta
51+
uses: docker/metadata-action@v5
52+
with:
53+
images: ${{ env.BUILD_KIT_IMAGE_NAME }}
54+
sep-tags: ","
55+
- name: Setup Docker buildx
56+
uses: docker/setup-buildx-action@v3
57+
- name: Build
58+
uses: docker/build-push-action@v6
59+
with:
60+
context: source/${{ inputs.build_kit_docker_directory }}
61+
push: false
62+
cache-from: type=gha
63+
cache-to: type=gha,mode=max
64+
build-args: ${{ env.BUILD_ARGS }}
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}
67+
outputs: type=docker,dest=build-kit.tar
68+
- name: Upload build-kit image
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: ${{ env.BUILD_KIT_ARTIFACT_NAME }}
72+
path: build-kit.tar
73+
- name: Set output tag
74+
id: set-outputs
75+
shell: python3 {0}
76+
run: |
77+
import os
78+
tags = "${{ steps.meta.outputs.tags }}".split(",")
79+
if len(tags) == 0:
80+
print("No tags found!❌")
81+
exit(1)
82+
tag = tags[0]
83+
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
84+
f.write(f"tag={tag}\n")
85+
print(f"Set tag={tag}")

0 commit comments

Comments
 (0)