Skip to content

Commit

Permalink
workflows: add EXPERIMENTAL Linux build jobs
Browse files Browse the repository at this point in the history
Epic: CRDB-8308
Release note: None
  • Loading branch information
rickystewart committed Mar 14, 2024
1 parent bf60272 commit 8116ffb
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 2 deletions.
58 changes: 56 additions & 2 deletions .github/workflows/github-actions-essential-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,60 @@ jobs:
- name: clean up
run: ./build/github/cleanup-engflow-keys.sh
if: always()
EXPERIMENTAL_linux_amd64_build:
runs-on: [self-hosted, basic_runner_group]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: compute metadata
run: echo GITHUB_ACTIONS_BRANCH=${{ github.event.pull_request.number || github.ref_name}} >> "$GITHUB_ENV"
- run: ./build/github/get-engflow-keys.sh
- run: ./build/github/prepare-summarize-build.sh
- name: build
run: ./build/github/build.sh crosslinux
- name: upload build results
run: ./build/github/summarize-build.sh bes.bin
if: always()
- name: clean up
run: ./build/github/cleanup-engflow-keys.sh
if: always()
EXPERIMENTAL_linux_amd64_fips_build:
runs-on: [self-hosted, basic_runner_group]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: compute metadata
run: echo GITHUB_ACTIONS_BRANCH=${{ github.event.pull_request.number || github.ref_name}} >> "$GITHUB_ENV"
- run: ./build/github/get-engflow-keys.sh
- run: ./build/github/prepare-summarize-build.sh
- name: build
run: ./build/github/build.sh crosslinuxfips
- name: upload build results
run: ./build/github/summarize-build.sh bes.bin
if: always()
- name: clean up
run: ./build/github/cleanup-engflow-keys.sh
if: always()
EXPERIMENTAL_linux_arm64_build:
runs-on: [self-hosted, basic_runner_group]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: compute metadata
run: echo GITHUB_ACTIONS_BRANCH=${{ github.event.pull_request.number || github.ref_name}} >> "$GITHUB_ENV"
- run: ./build/github/get-engflow-keys.sh
- run: ./build/github/prepare-summarize-build.sh
- name: build
run: ./build/github/build.sh crosslinuxarm
- name: upload build results
run: ./build/github/summarize-build.sh bes.bin
if: always()
- name: clean up
run: ./build/github/cleanup-engflow-keys.sh
if: always()
macos_amd64_build:
runs-on: [self-hosted, basic_runner_group]
steps:
Expand All @@ -172,7 +226,7 @@ jobs:
- run: ./build/github/get-engflow-keys.sh
- run: ./build/github/prepare-summarize-build.sh
- name: build
run: bazel build //pkg/cmd/cockroach //pkg/cmd/cockroach-short //pkg/cmd/cockroach-sql //pkg/cmd/cockroach-oss //pkg/cmd/roachprod //pkg/cmd/workload //pkg/cmd/dev //c-deps:libgeos --config crossmacos --jobs 100 --remote_download_minimal --build_event_binary_file=bes.bin $(./build/github/engflow-args.sh)
run: ./build/github/build.sh crossmacos
- name: upload build results
run: ./build/github/summarize-build.sh bes.bin
if: always()
Expand All @@ -190,7 +244,7 @@ jobs:
- run: ./build/github/get-engflow-keys.sh
- run: ./build/github/prepare-summarize-build.sh
- name: build
run: bazel build //pkg/cmd/cockroach //pkg/cmd/cockroach-short //pkg/cmd/cockroach-sql //pkg/cmd/cockroach-oss //pkg/cmd/roachprod //pkg/cmd/workload //pkg/cmd/dev //c-deps:libgeos --config crossmacosarm --jobs 100 --remote_download_minimal --build_event_binary_file=bes.bin $(./build/github/engflow-args.sh)
run: ./build/github/build.sh crossmacosarm
- name: upload build results
run: ./build/github/summarize-build.sh bes.bin
if: always()
Expand Down
45 changes: 45 additions & 0 deletions build/github/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
set -euxo pipefail

# Usage: must provide a cross config as argument

if [ -z "$1" ]
then
echo 'Usage: build.sh CONFIG'
exit 1
fi

CONFIG="$1"

EXTRA_TARGETS=

# Extra targets to build on Linux x86_64 only.
if [ "$CONFIG" == "crosslinux" ]
then
EXTRA_TARGETS=$(grep '^//' docs/generated/bazel_targets.txt)
fi

# Extra targets to build on Unix only.
if [ "$CONFIG" != "crosswindows" ]
then
EXTRA_TARGETS="$EXTRA_TARGETS //pkg/cmd/roachprod //pkg/cmd/workload //pkg/cmd/dev //pkg/cmd/bazci //pkg/cmd/bazci/process-bep-file"
fi

EXTRA_ARGS=
# GEOS does not compile on windows.
GEOS_TARGET=//c-deps:libgeos

if [ "$CONFIG" == "crosswindows" ]
then
EXTRA_ARGS=--enable_runfiles
GEOS_TARGET=
fi

bazel build \
--config "$CONFIG" $EXTRA_ARGS \
--jobs 100 \
--build_event_binary_file=bes.bin \
$(./build/github/engflow-args.sh) \
//pkg/cmd/cockroach-short //pkg/cmd/cockroach \
//pkg/cmd/cockroach-sql \
//pkg/cmd/cockroach-oss $GEOS_TARGET $EXTRA_TARGETS

0 comments on commit 8116ffb

Please sign in to comment.