Skip to content

Commit

Permalink
ci(test): add e2e tests to ci pipeline (#602)
Browse files Browse the repository at this point in the history
* ci(test): add e2e tests to ci pipeline

* ci(test): use artifacts
  • Loading branch information
paralta committed Sep 8, 2023
1 parent 41efac0 commit 9f46347
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-and-push-component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ on:
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -60,7 +65,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
platforms: ${{ matrix.platform }}
tags: ghcr.io/openclarity/${{ inputs.image_name }}:${{ inputs.image_tag }}
file: ${{ inputs.dockerfile }}
push: ${{ inputs.push }}
Expand All @@ -73,7 +78,7 @@ jobs:
COMMIT_HASH=${{ github.sha }}
- name: Upload artifact
if: ${{ inputs.upload == 'true' }}
if: ${{ inputs.upload == 'true' && matrix.platform == 'linux/amd64'}}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.image_name }}
Expand Down
42 changes: 41 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,52 @@ jobs:
with:
image_tag: ${{ github.sha }}
push: false
upload: false
upload: true

test:
needs: build
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Download all artifacts
uses: actions/download-artifact@v3

- name: Load Docker images
run: |
ls
docker load --input vmclarity-apiserver/vmclarity-apiserver.tar
docker load --input vmclarity-orchestrator/vmclarity-orchestrator.tar
docker load --input vmclarity-ui-backend/vmclarity-ui-backend.tar
docker load --input vmclarity-ui/vmclarity-ui.tar
docker load --input vmclarity-cli/vmclarity-cli.tar
docker image ls -a
- name: Run end to end tests
env:
DOCKER_TAG: ${{ github.sha }}
APIServerContainerImage: ghcr.io/openclarity/vmclarity-apiserver:${{ github.sha }}
OrchestratorContainerImage: ghcr.io/openclarity/vmclarity-orchestrator:${{ github.sha }}
UIContainerImage: ghcr.io/openclarity/vmclarity-ui:${{ github.sha }}
UIBackendContainerImage: ghcr.io/openclarity/vmclarity-ui-backend:${{ github.sha }}
ScannerContainerImage: ghcr.io/openclarity/vmclarity-cli:${{ github.sha }}
run: cd e2e && go test -v -failfast -test.v -test.paniconexit0 -timeout 2h -ginkgo.v .

success:
needs:
- build
- helm-docs-verification
name: Success
runs-on: ubuntu-latest
steps:
- name: Echo Success
Expand Down

0 comments on commit 9f46347

Please sign in to comment.