Skip to content

Commit

Permalink
chore(ci): build docker images in merge queue (#2562)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas authored Aug 30, 2024
1 parent 947cdff commit 14d12e6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,33 @@ jobs:
- uses: actions/checkout@v4
- uses: cashapp/activate-hermit@v1
- run: go-arch-lint check || true
docker-build-controller:
name: Build Controller Docker Image
if: github.event_name != 'pull_request' || github.event.action == 'enqueued' || contains( github.event.pull_request.labels.*.name, 'run-all')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cashapp/activate-hermit@v1
- uses: ./.github/actions/build-cache
- run: just build-docker controller
docker-build-runner:
name: Build Runner Docker Image
if: github.event_name != 'pull_request' || github.event.action == 'enqueued' || contains( github.event.pull_request.labels.*.name, 'run-all')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cashapp/activate-hermit@v1
- uses: ./.github/actions/build-cache
- run: just build-docker runner
docker-build-box:
name: Build Box Docker Image
if: github.event_name != 'pull_request' || github.event.action == 'enqueued' || contains( github.event.pull_request.labels.*.name, 'run-all')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cashapp/activate-hermit@v1
- uses: ./.github/actions/build-cache
- run: just build-docker box
console-e2e:
name: Console e2e
if: github.event_name != 'pull_request' || github.event.action == 'enqueued' || contains( github.event.pull_request.labels.*.name, 'run-all')
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: cashapp/activate-hermit@v1
- name: Build
run: |
docker build -t ftl0/ftl-runner:"$GITHUB_SHA" -t ftl0/ftl-runner:latest -f Dockerfile.runner .
just build-docker runner
mkdir -p artifacts/ftl-runner
docker save -o artifacts/ftl-runner/ftl-runner.tar ftl0/ftl-runner:latest
- name: Temporarily save Docker image
Expand All @@ -34,7 +34,7 @@ jobs:
uses: cashapp/activate-hermit@v1
- name: Build
run: |
docker build -t ftl0/ftl-controller:"$GITHUB_SHA" -t ftl0/ftl-controller:latest -f Dockerfile.controller .
just build-docker controller
mkdir -p artifacts/ftl-controller
docker save -o artifacts/ftl-controller/ftl-controller.tar ftl0/ftl-controller:latest
- name: Temporarily save Docker image
Expand All @@ -53,7 +53,7 @@ jobs:
uses: cashapp/activate-hermit@v1
- name: Build
run: |
docker build -t ftl0/ftl-box:"$GITHUB_SHA" -t ftl0/ftl-box:latest -f Dockerfile.box .
just build-docker box
mkdir -p artifacts/ftl-box
docker save -o artifacts/ftl-box/ftl-box.tar ftl0/ftl-box:latest
- name: Temporarily save Docker image
Expand Down Expand Up @@ -163,6 +163,8 @@ jobs:
git push origin main
vscode-release:
name: Release VSCode Extension
# Disabled for now as it's broken.
if: false
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
7 changes: 5 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ debug *args:
# `just otel-dev` with any args you would pass to `ftl dev`. To stop the otel stream, run
# `just otel-stop` in a third terminal tab.
otel-stream:
#!/bin/bash

docker run \
-p ${OTEL_GRPC_PORT}:${OTEL_GRPC_PORT} \
-p 55679:55679 \
Expand All @@ -218,6 +216,7 @@ otel-stop:
# Run `ftl dev` with the given args after setting the necessary envar.
otel-dev *args:
#!/bin/bash
set -euo pipefail

export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:${OTEL_GRPC_PORT}"
export OTEL_METRIC_EXPORT_INTERVAL=${OTEL_METRIC_EXPORT_INTERVAL}
Expand All @@ -240,3 +239,7 @@ grafana-stop:
storybook:
#!/bin/bash
cd frontend && pnpm run storybook

# Build an FTL Docker image.
build-docker name:
docker build --platform linux/amd64 -t ftl0/ftl-{{name}}:"${GITHUB_SHA:-$(git rev-parse HEAD)}" -t ftl0/ftl-{{name}}:latest -f Dockerfile.{{name}} .
2 changes: 1 addition & 1 deletion scripts/go-test-annotate
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -euo pipefail
# then match lines containing lines that look like error messages.

fail=0
if ! gotestsum --format-hide-empty-pkg --junitfile junit-go.xml --junitfile-hide-empty-pkg -- -race -fullpath "$@" ./...; then
if ! gotestsum --format-hide-empty-pkg --junitfile junit-go.xml --junitfile-hide-empty-pkg -- -timeout 10m -race -fullpath "$@" ./...; then
fail=1
fi

Expand Down

0 comments on commit 14d12e6

Please sign in to comment.