Skip to content

Commit

Permalink
feat: improve build by building the images only once (#1538)
Browse files Browse the repository at this point in the history
Co-authored-by: Tamir David <[email protected]>
  • Loading branch information
tamirdavid1 and Tamir David authored Sep 25, 2024
1 parent 78ee95e commit e3f2416
Showing 1 changed file with 51 additions and 9 deletions.
60 changes: 51 additions & 9 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,36 @@ concurrency:
cancel-in-progress: true

jobs:
build-odigos-images:
runs-on: warp-ubuntu-latest-x64-8x-spot
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build CLI
run: |
cd cli
go build -tags=embed_manifests -o odigos
- name: Build Odigos Images
run: |
TAG=e2e-test make build-images
docker save -o odigos-images.tar $(docker images --format "{{.Repository}}:{{.Tag}}" | grep "odigos")
- name: Upload CLI
uses: actions/upload-artifact@v3
with:
name: odigos-cli
path: cli/odigos

- name: Upload Odigos Images
uses: actions/upload-artifact@v3
with:
name: odigos-images
path: odigos-images.tar

kubernetes-test:
needs: build-odigos-images
runs-on: warp-ubuntu-latest-x64-8x-spot
strategy:
fail-fast: false
Expand All @@ -31,8 +60,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up Go
uses: actions/setup-go@v5
with:
Expand All @@ -41,29 +69,43 @@ jobs:
cache: true
cache-dependency-path: |
**/go.sum
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.9.0

- name: Install chainsaw
uses: kyverno/[email protected]

- name: Create Kind Cluster
uses: helm/[email protected]
with:
node_image: ${{ matrix.kind-image }}
version: "v0.23.0"
cluster_name: kind

- name: Install FE
run: |
cd frontend/webapp
yarn install
- name: Build CLI
run: |
cd cli
go build -tags=embed_manifests -o odigos
- name: Build and Load Odigos Images
run: |
TAG=e2e-test make build-images load-to-kind
- name: Download and Load Docker Images to Kind
uses: actions/download-artifact@v3
with:
name: odigos-images
- run: |
docker load -i odigos-images.tar
TAG=e2e-test make load-to-kind
- name: Download CLI binary
uses: actions/download-artifact@v3
with:
name: odigos-cli
- run: |
mv odigos cli/odigos
chmod +x cli/odigos
- name: Run E2E Tests
run: |
chainsaw test tests/e2e/${{ matrix.test-scenario }}

0 comments on commit e3f2416

Please sign in to comment.