generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 7
/
e2e-backup.yml
73 lines (68 loc) · 2.54 KB
/
e2e-backup.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: E2E Tests
on:
workflow_dispatch:
inputs:
environment:
description: Environment where to run tests
required: true
type: environment
default: dev
jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
subaccounts: ${{ steps.subaccounts.outputs.subaccounts }}
steps:
- name: Download BTP CLI
run: |
curl --cookie 'eula_3_2_agreed=tools.hana.ondemand.com/developer-license-3_2.txt' -o btp.tar.gz https://tools.hana.ondemand.com/additional/btp-cli-linux-amd64-2.64.0.tar.gz
tar -xvzf btp.tar.gz
mv ./linux-amd64/btp .
rm btp.tar.gz
rm -r ./linux-amd64
- name: BTP Login
env:
IAS_USERNAME: ${{ secrets.IAS_USERNAME }}
IAS_PASSWORD: ${{ secrets.IAS_PASSWORD }}
BTP_URL: ${{ vars.BTP_URL }}
BTP_SUBDOMAIN: ${{ vars.BTP_SUBDOMAIN }}
BTP_IDP: ${{ vars.BTP_IDP }}
run: |
btp login --url "$BTP_URL" --subdomain "$BTP_SUBDOMAIN" --idp "$BTP_IDP" --user "$IAS_USERNAME" --password "$IAS_PASSWORD"
btp set config --format json
- name: Find subaccounts
id: subaccounts
run: |
btp list accounts/subaccount --labels-filter phx-e2e=true > subaccount-details.json
jq -c '. | .value[] |= .guid | .value' subaccount-details.json > subaccounts.json
echo "subaccounts=`cat subaccounts.json`" >> "$GITHUB_OUTPUT"
run-tests:
runs-on: ubuntu-latest
needs: define-matrix
strategy:
matrix:
subaccount: ${{ fromJSON(needs.define-matrix.outputs.subaccounts) }}
steps:
- uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Build
run: |
go mod tidy
go mod download
go build -o bin/kfr cmd/main.go
- name: BTP Login
env:
IAS_USERNAME: ${{ secrets.IAS_USERNAME }}
IAS_PASSWORD: ${{ secrets.IAS_PASSWORD }}
BTP_URL: ${{ vars.BTP_URL }}
BTP_SUBDOMAIN: ${{ vars.BTP_SUBDOMAIN }}
BTP_IDP: ${{ vars.BTP_IDP }}
run: |
btp login --url "$BTP_URL" --subdomain "$BTP_SUBDOMAIN" --idp "$BTP_IDP" --user "$IAS_USERNAME" --password "$IAS_PASSWORD"
btp set config --format json
btp list accounts/subaccount
btp list accounts/subaccount --labels-filter phx-e2e=true > subaccounts.json
jq -c '. | .value[] |= .guid | .value' subaccounts.json