Skip to content

Commit

Permalink
split executor container image job and bazel job
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbreen committed Sep 4, 2023
1 parent 6bd0729 commit f1cd990
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,37 @@ on:

jobs:

build:

executors:
name: Build & Push Executor Container Images
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: |
executors
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v2
- uses: docker/bake-action@v3
with:
push: true
workdir: executors
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
bazel:
name: Bazel Build & Test
runs-on: ubuntu-latest
needs:
- executors
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v2
- uses: docker/bake-action@v3
with:
push: true
workdir: executors
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
- name: Bazel Home RC
run: |
echo "build --disk_cache=~/.cache/bazel.disk" >> ~/.bazelrc
Expand All @@ -39,11 +47,12 @@ jobs:
with:
path: ${{github.workspace}}/.cache/bazel.disk
key: bazel
- name: Bazel Build
- uses: actions/checkout@v3
- name: Bazel Build with Docker
run: sudo runuser -u runner -g runner -G docker -- bazel build --config docker hellos tars rpms debs
- name: Bazel Host Tests
run: sudo runuser -u runner -g runner -G docker -- bazel test --config docker --strategy=TestRunner=sandboxed host-{hellos,tars}-test # We won't test the RPM and DEB tests on the host as they actually install the package.
- name: Bazel Platform Tests
- name: Bazel Docker Tests
run: sudo runuser -u runner -g runner -G docker -- bazel test --config docker --strategy=TestRunner=docker platform-{hello,tar,rpm,deb}-test-suite
- name: Work around https://github.com/actions/upload-artifact/issues/92
run: echo "bazel_out=$(sudo runuser -u runner -g runner -G docker -- bazel info output_path)" >> $GITHUB_ENV
Expand Down

0 comments on commit f1cd990

Please sign in to comment.