Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve build by building the images only once #1538

Merged
merged 8 commits into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/action-install-chainsaw@v0.2.8

- name: Create Kind Cluster
uses: helm/kind-action@v1.10.0
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 }}
Loading