-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (81 loc) · 2.46 KB
/
payment.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
name: Run Python Script in Parallel
on:
push:
branches:
- payment
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the tests in'
required: true
default: 'prod'
type: choice
options:
- dev
- staging
- prod
env:
jsonAccountDataPath: "./accountsData.json"
ENVIRONMENT: 'prod'
jobs:
setup_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Generate matrix for account IDs
id: set-matrix
run: |
echo "Reading account IDs from JSON for specified environment..."
ACCOUNT_IDS=$(python fetch_account_ids.py --environment ${{ env.ENVIRONMENT }} --jsonFile ${{ env.jsonAccountDataPath }})
echo "# ----------------- ACCOUNT IDS----------------- #"
echo "$ACCOUNT_IDS"
echo "# ------------------------------------------------ #"
echo "matrix=$ACCOUNT_IDS" >> $GITHUB_OUTPUT
run_tests:
needs: setup_matrix
runs-on: ubuntu-latest
strategy:
matrix:
account: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
steps:
- name: Generate uuid
id: uuid
run: |
echo "RANDOM_UUID=systets-$(uuidgen)" >> $GITHUB_OUTPUT
- name: Create k8s Kind Cluster
id: kind-cluster-install
uses: helm/[email protected]
with:
cluster_name: ${{ steps.uuid.outputs.RANDOM_UUID }}
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v4
timeout-minutes: 10
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run test for each account ID
env:
email_sso: ${{ secrets.EMAIL_SSO }}
login_pass_sso: ${{ secrets.LOGIN_PASS_SSO }}
run: |
echo "Running script for account ID: ${{ matrix.account }}"
python payment.py --account-id ${{ matrix.account }}
- name: upload screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: screenshots
path: |
./*.png