add gmc e2e #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2024 Intel Corporation | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Golang E2e Tests | |
on: | |
pull_request: | |
branches: [main] | |
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped | |
paths: | |
- microservices-connector/** | |
workflow_dispatch: | |
# If there is a new commit, the previous jobs will be canceled | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
GOSRC_DIR: "microservices-connector" | |
jobs: | |
go-e2e: | |
runs-on: k8s | |
steps: | |
- name: Checkout out Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set variables | |
run: | | |
echo "SYSTEM_NAMESPACE=opea-system-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV | |
echo "APP_NAMESPACE=chatqna-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV | |
echo "DOCKER_REGISTRY=$OPEA_IMAGE_REPO/opea" >> $GITHUB_ENV | |
echo "VERSION=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV | |
echo "should_cleanup=false" >> $GITHUB_ENV | |
echo "skip_validate=false" >> $GITHUB_ENV | |
- name: Build image and push | |
run: | | |
cd $GOSRC_DIR | |
make docker.build | |
make docker.push | |
- name: Install modules | |
run: | | |
echo "should_cleanup=true" >> $GITHUB_ENV | |
.github/workflows/scripts/e2e/go_test.sh install_gmc | |
exit_status=$$?$$ | |
if [ $$exit_status -ne 0 ]; then | |
echo "Failed to install modules" | |
echo "skip_validate=true" >> $GITHUB_ENV | |
fi | |
- name: Run e2e tests | |
run: | | |
# export DOCKER_REGISTRY={{ env.DOCKER_REGISTRY }} | |
# export VERSION={{ env.VERSION }} | |
if $skip_validate; then | |
echo "Skip validate" | |
else | |
.github/workflows/scripts/e2e/go_test.sh validate_gmc | |
fi | |
- name: Cleanup modules | |
if: always() | |
run: | | |
if $should_cleanup; then | |
.github/workflows/scripts/e2e/go_test.sh cleanup_gmc | |
fi |