This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
Update README.md #284
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
name: End2End Test | |
on: | |
workflow_call: | |
inputs: | |
UPGRADE_TEST: | |
description: 'Set to "true" to enable version upgrade testing before E2E testing' | |
default: '' | |
required: false | |
type: string | |
secrets: | |
CURRENT_RELEASE_VERSION: | |
description: 'Release version to upgrade from, must be a valid docker tag' | |
required: false | |
DOCKER_PASSWORD: | |
description: 'Dockerhub Password' | |
required: false | |
DOCKER_USERNAME: | |
description: 'Dockerhub Username' | |
required: false | |
pull_request: | |
branches: | |
- develop | |
push: | |
branches: | |
- develop | |
- '**-debugtest' | |
jobs: | |
build: | |
env: | |
UPGRADE_TEST: '' | |
CURRENT_RELEASE_VERSION: '' | |
SELF_HOSTED_RUNNER: true | |
runs-on: private | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- uses: actions/checkout@v3 | |
with: | |
repository: IndustryFusion/DigitalTwin | |
path: ./DigitalTwin | |
- name: Set Env | |
env: | |
CRV: ${{ secrets.CURRENT_RELEASE_VERSION }} | |
if: ${{ inputs.UPGRADE_TEST == 'true' && env.CRV != '' }} | |
run: | | |
set +o pipefail | |
echo "UPGRADE_TEST=${{ inputs.UPGRADE_TEST }}" >> $GITHUB_ENV | |
echo "CURRENT_RELEASE_VERSION=${{ secrets.CURRENT_RELEASE_VERSION }}" >> $GITHUB_ENV | |
- name: Prepare OISP platform | |
shell: bash | |
run: | | |
export TERM=vt100 | |
if [ -z "${SELF_HOSTED_RUNNER}" ]; then | |
cd util && \ | |
bash setup-ubuntu20.04.sh | |
fi | |
- name: Prepare Digital Twin | |
shell: bash | |
run: | | |
if [ -z "${SELF_HOSTED_RUNNER}" ]; then | |
( cd ./DigitalTwin/test && bash ./prepare-platform.sh ) | |
else | |
( cd ./DigitalTwin/test && bash ./prepare-platform-for-self-hosted-runner.sh ) | |
fi | |
- name: Prepare IFF Bats Framework | |
shell: bash | |
run: | | |
cd ./DigitalTwin/test/bats | |
bash ./prepare-test.sh | |
bats linting.bats | |
shellcheck *.sh *.bats test-*/*.bats | |
- name: Build Digital Twin locally | |
shell: bash | |
run: | | |
cd ./DigitalTwin/test && bash build-local-platform.sh | |
- name: Install Digital Twin from local registry | |
shell: bash | |
run: | | |
cd ./DigitalTwin/test | |
retval=2 | |
loops=0 | |
until bash install-local-platform.sh || [ ${loops} -gt 3 ]; do | |
loops=$((loops+1)) | |
echo loop: ${loops} | |
k3d cluster delete iff-cluster | |
if [ -z "${SELF_HOSTED_RUNNER}" ]; then | |
bash ./prepare-platform.sh | |
else | |
bash ./prepare-platform-for-self-hosted-runner.sh | |
fi | |
done | |
if [ ${loops} -gt 3 ]; then exit 1; fi | |
- name: Setup subrepos | |
shell: bash | |
run: | | |
export TERM=vt100 | |
git submodule update --recursive --init | |
make update | |
- name: Build OISP platform | |
run: | | |
set +o pipefail | |
export TERM=vt100 | |
yes | DOCKER_TAG=test NODOCKERLOGIN=true DEBUG=true make build | |
- name: Prepare OISP Bats Framework | |
shell: bash | |
run: | | |
cd ./tests/bats | |
bash ./prepare-bats.sh | |
bats linting.bats | |
shellcheck *.sh *.bats test-*/*.bats | |
- name: E2E Test | |
shell: bash | |
run: | | |
set +e | |
export TERM=vt100 | |
export PATH=$PATH:/snap/bin | |
make import-images DOCKER_TAG=test DEBUG=true | |
docker image prune -a -f | |
rm -rf oisp-* | |
npm install nodemailer | |
export NODOCKERLOGIN=true | |
retval=2; | |
export DOCKER_TAG=test | |
export USE_LOCAL_REGISTRY=true | |
make deploy-oisp-test | |
make test | |
retval=$? | |
echo Test return value: ${retval} | |
exit ${retval} |