This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
132 lines (130 loc) · 3.69 KB
/
makefile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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}