Skip to content

Commit

Permalink
Run kernel builds on self-hosted runners:
Browse files Browse the repository at this point in the history
Also, always output the matrix.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed May 1, 2024
1 parent 14473d4 commit 538637f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-all-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ env: # Global environment, passed to all jobs & all steps

# GHA runner configuration. See bash/json-matrix.sh for more details.
CI_RUNNER_LK_CONTAINERS_ARM64: "ARM64" # Use a self-hosted runner with the "ARM64" tag for the ARM64 builds of LK containers
CI_RUNNER_KERNEL_AMD64: "X86" # Use a self-hosted runner with the "X86" tag for the AMD64 kernel builds
CI_RUNNER_KERNEL_ARM64: "ARM64" # Use a self-hosted runner with the "ARM64" tag for the ARM64 kernel builds


jobs:

Expand Down Expand Up @@ -129,7 +132,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Docker Login to DockerHub # read-only token, required to be able to pull all the linuxkit pkgs without getting rate limited.
if: ${{ env.LOGIN_TO_DOCKERHUB == 'yes' }}
if: ${{ env.LOGIN_TO_DOCKERHUB == 'yes' && github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
with: { registry: "docker.io", username: "${{ secrets.DOCKERHUB_USERNAME }}", password: "${{ secrets.DOCKERHUB_PASSWORD }}" }

Expand Down
12 changes: 6 additions & 6 deletions bash/json-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ function output_gha_matrixes() {
prepare_json_matrix_lkcontainers "LK_CONTAINERS" # reads all_arches's keys and sets full_json
declare lkcontainers_json="${full_json}"

# If under GHA, set a GHA output variable, otherwise just log them
if [[ -z "${GITHUB_OUTPUT}" ]]; then
log info "Would have set GHA output kernels_json to: ${kernels_json}"
log info "Would have set GHA output lk_hooks_json to: ${lk_hooks_json}"
log info "Would have set GHA output lkcontainers_json to: ${lkcontainers_json}"
else
log info "kernels_json to: ${kernels_json}"
log info "lk_hooks_json to: ${lk_hooks_json}"
log info "lkcontainers_json to: ${lkcontainers_json}"

# If under GHA, set a GHA output variable.
if [[ -n "${GITHUB_OUTPUT}" ]]; then
# shellcheck disable=SC2129 # no, thanks, shellcheck.
echo "kernels_json=${kernels_json}" >> "${GITHUB_OUTPUT}"
echo "lk_hooks_json=${lk_hooks_json}" >> "${GITHUB_OUTPUT}"
Expand Down

0 comments on commit 538637f

Please sign in to comment.