-
Notifications
You must be signed in to change notification settings - Fork 14
50 lines (45 loc) · 1.27 KB
/
integration-tests.yml
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
name: Integration tests
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker build
run: |
docker build \
--tag swedbankpay/sdk-consumer:0.0.1 \
. \
--file tests/sdk-consumer/Dockerfile
- name: Get version number from composer.json
env:
COMPOSER_VERSION: 99.98.97-dev
run: |
jq ".version=\"${COMPOSER_VERSION}\"" composer.json > composer.version.json # Add "version" property to composer.version.json
rm -f composer.lock
rm -f composer.json
mv composer.version.json composer.json
cat composer.json
RESULT=$(\
docker run \
--rm \
--volume $(pwd)/tests/sdk-consumer:/app \
--volume $(pwd):/sdk \
--env VERSION=$VERSION \
swedbankpay/sdk-consumer:0.0.1\
)
echo $RESULT
SDKVERSION=$(echo $RESULT | grep -Po 'sdkversion: .*' | cut -d' ' -f2)
if [ "$SDKVERSION" == "$COMPOSER_VERSION" ]; then
echo "Equality has been achieved."
exit 0
else
echo "'$SDKVERSION' and '$COMPOSER_VERSION' are not equal."
exit 1
fi