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 8
109 lines (109 loc) · 2.99 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
name: End2End Test
on:
pull_request:
branches:
- develop
push:
branches:
- develop
- '**-debugtest'
jobs:
build:
env:
SELF_HOSTED_RUNNER: true
runs-on: private
steps:
- uses: actions/checkout@v3
with:
repository: Open-IoT-Service-Platform/platform-launcher.git
ref: 'develop'
path: platform-launcher
- uses: actions/checkout@v3
with:
repository: IndustryFusion/DigitalTwin
path: DigitalTwin
- name: Setup main repo + subrepos
shell: bash
run: |
export TERM=vt100
if [ -z "${SELF_HOSTED_RUNNER}" ]; then
sudo apt install jq
fi
cd platform-launcher
git submodule update --init --recursive
make update
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
path: platform-launcher/oisp-mqtt-gw
- name: Prepare platform
shell: bash
working-directory: platform-launcher
run: |
export TERM=vt100
if [ -z "${SELF_HOSTED_RUNNER}" ]; then
cd util && \
bash setup-ubuntu20.04.sh
else
make restart-cluster
fi
- name: Prepare Digital Twin
working-directory: DigitalTwin
shell: bash
run: |
if [ -z "${SELF_HOSTED_RUNNER}" ]; then
( cd ./test && bash ./prepare-platform.sh )
else
( cd ./test && bash ./prepare-platform-for-self-hosted-runner.sh )
fi
- name: Prepare Bats Framework
working-directory: DigitalTwin
shell: bash
run: |
cd ./test/bats
bash ./prepare-test.sh
bats linting.bats
shellcheck *.sh *.bats test-*/*.bats
- name: Build Digital Twin locally
working-directory: DigitalTwin
shell: bash
run: |
cd ./test && bash build-local-platform.sh
- name: Install Digital Twin from local registry
working-directory: DigitalTwin
shell: bash
run: |
cd ./test && bash install-local-platform.sh
- name: Build platform
working-directory: platform-launcher
shell: bash
run: |
set +o pipefail
export TERM=vt100
yes | DOCKER_TAG=test NODOCKERLOGIN=true DEBUG=true make build
- name: E2E Test
id: e2etest
working-directory: platform-launcher
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
loops=0
export DOCKER_TAG=test
export USE_LOCAL_REGISTRY=true
until [ ${retval} -eq 0 ] || [ ${loops} -gt 3 ]; do
make undeploy-oisp
(for i in {1..20}; do sleep 60; echo .; done&) && make deploy-oisp-test
make test
retval=$?
loops=$((loops+1))
done
echo Test return value: ${retval}
exit ${retval}