Skip to content

Commit 9aa9b2f

Browse files
committed
Update python-workflow.yml
1 parent dbaedf9 commit 9aa9b2f

File tree

1 file changed

+89
-116
lines changed

1 file changed

+89
-116
lines changed

.github/workflows/python-workflow.yml

Lines changed: 89 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -3,120 +3,93 @@ on:
33
push:
44
pull_request:
55
workflow_dispatch:
6-
# env:
7-
# CLIENT_FOLDER: 'cybersource-rest-client-python'
8-
# SAMPLE_FOLDER: 'cybersource-rest-samples-python'
9-
# jobs:
10-
# workflow-job:
11-
# defaults:
12-
# run:
13-
# shell: bash
14-
# strategy:
15-
# fail-fast: false
16-
# matrix:
17-
# operating-system: [ubuntu-latest,macos-latest,windows-latest]
18-
# pyth-version: ['3.6','3.7','3.8','3.9','3.10','3.11','3.12']
19-
# include:
20-
# - operating-system: ubuntu-20.04 # Checking support for ubuntu os with python 3.6
21-
# pyth-version: '3.6'
22-
# - operating-system: macos-13 # Checking support for mac os with python 3.6
23-
# pyth-version: '3.6'
24-
# - operating-system: macos-13 # Checking support for mac os with python 3.7
25-
# pyth-version: '3.7'
26-
# exclude:
27-
# - operating-system: ubuntu-latest #arm 64 doesn't support python ver 3.7
28-
# pyth-version: '3.6'
29-
# - operating-system: macos-latest #arm 64 doesn't support python ver 3.6
30-
# pyth-version: '3.6'
31-
# - operating-system: macos-latest #arm 64 doesn't support python ver 3.7
32-
# pyth-version: '3.7'
33-
# runs-on: ${{matrix.operating-system}}
34-
# steps:
35-
# - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
36-
# if: runner.os == 'Windows'
37-
# shell: pwsh
38-
# - run: vcpkg install openssl:x64-windows-static-md
39-
# if: runner.os == 'Windows'
40-
# shell: pwsh
41-
# - name: Creating separate folders for checkout repos
42-
# run: |
43-
# rm -rf $CLIENT_FOLDER
44-
# rm -rf $SAMPLE_FOLDER
45-
# mkdir $CLIENT_FOLDER $SAMPLE_FOLDER
46-
# - name: Checkout cybersource-rest-client-python repo
47-
# uses: actions/checkout@v4
48-
# with:
49-
# path: ${{env.CLIENT_FOLDER}}
50-
# - name: Checkout cybersource-rest-samples-python repo
51-
# uses: actions/checkout@v4
52-
# with:
53-
# repository: 'CyberSource/cybersource-rest-samples-python'
54-
# ref: 'testing-branch' # this is used for checking out a particular branch in repo
55-
# path: ${{env.SAMPLE_FOLDER}}
56-
# - name: Install Python
57-
# uses: actions/setup-python@v5
58-
# with:
59-
# python-version: ${{matrix.pyth-version}}
60-
# - name: Building the projects and running the Test Cases
61-
# run: |
62-
# python --version
63-
# python -m pip install --upgrade pip
64-
# python -m venv ve
65-
# if [[ "$(uname -s)" == "Linux" ]]; then
66-
# echo "In LINUX"
67-
# source ve/bin/activate
68-
# elif [[ "$(uname -s)" == "Darwin" ]]; then
69-
# echo "In MAC"
70-
# source ve/bin/activate
71-
# else
72-
# echo "In Windows"
73-
# source ve/Scripts/activate
74-
# fi
75-
# echo $VIRTUAL_ENV
76-
# cd $CLIENT_FOLDER
77-
# pip install -e .
78-
# cd ..
79-
# echo $VIRTUAL_ENV
80-
# cd $SAMPLE_FOLDER
81-
# pip install -e .
82-
# bash ./sample_code_runner.sh
83-
# - name: Using Report Generation Action
84-
# id: report-generation
85-
# uses: ./cybersource-rest-client-python/.github/actions/generate-report
86-
# with:
87-
# lang: python
88-
# sample-folder-name: ${{env.SAMPLE_FOLDER}}
89-
# log-file-name: output.log
90-
# - name: Upload Test Reports
91-
# uses: actions/upload-artifact@v4
92-
# with:
93-
# name: sample-run-report-${{matrix.operating-system}}-python-ver-${{matrix.pyth-version}}
94-
# path: |
95-
# ${{env.SAMPLE_FOLDER}}/${{steps.report-generation.outputs.result-pdf-name}}
96-
6+
env:
7+
CLIENT_FOLDER: 'cybersource-rest-client-python'
8+
SAMPLE_FOLDER: 'cybersource-rest-samples-python'
979
jobs:
98-
99-
job:
100-
runs-on: ubuntu-latest
101-
strategy:
102-
fail-fast: false
103-
matrix:
104-
pyth-version: ['3.6','3.7','3.8','3.9','3.10','3.11','3.12']
105-
allowed-fail: [false]
106-
exclude:
107-
- pyth-version: '3.12'
108-
allowed-fail: false
109-
include:
110-
- pyth-version: '3.12'
111-
allowed-fail: true
112-
steps:
113-
- name: Allowed to fail step
114-
if: ${{matrix.allowed-fail}}
115-
run: |
116-
echo "In ALLOWED TO FAIL"
117-
exit 1
118-
continue-on-error: true
119-
- name: step2
120-
run: echo "Step 2"
121-
122-
10+
workflow-job:
11+
defaults:
12+
run:
13+
shell: bash
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
operating-system: [ubuntu-latest,macos-latest,windows-latest]
18+
pyth-version: ['3.6','3.7','3.8','3.9','3.10','3.11','3.12']
19+
include:
20+
- operating-system: ubuntu-20.04 # Checking support for ubuntu os with python 3.6
21+
pyth-version: '3.6'
22+
- operating-system: macos-13 # Checking support for mac os with python 3.6
23+
pyth-version: '3.6'
24+
- operating-system: macos-13 # Checking support for mac os with python 3.7
25+
pyth-version: '3.7'
26+
exclude:
27+
- operating-system: ubuntu-latest #arm 64 doesn't support python ver 3.7
28+
pyth-version: '3.6'
29+
- operating-system: macos-latest #arm 64 doesn't support python ver 3.6
30+
pyth-version: '3.6'
31+
- operating-system: macos-latest #arm 64 doesn't support python ver 3.7
32+
pyth-version: '3.7'
33+
runs-on: ${{matrix.operating-system}}
34+
steps:
35+
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
36+
if: runner.os == 'Windows'
37+
shell: pwsh
38+
- run: vcpkg install openssl:x64-windows-static-md
39+
if: runner.os == 'Windows'
40+
shell: pwsh
41+
- name: Creating separate folders for checkout repos
42+
run: |
43+
rm -rf $CLIENT_FOLDER
44+
rm -rf $SAMPLE_FOLDER
45+
mkdir $CLIENT_FOLDER $SAMPLE_FOLDER
46+
- name: Checkout cybersource-rest-client-python repo
47+
uses: actions/checkout@v4
48+
with:
49+
path: ${{env.CLIENT_FOLDER}}
50+
- name: Checkout cybersource-rest-samples-python repo
51+
uses: actions/checkout@v4
52+
with:
53+
repository: 'CyberSource/cybersource-rest-samples-python'
54+
ref: 'testing-branch' # this is used for checking out a particular branch in repo
55+
path: ${{env.SAMPLE_FOLDER}}
56+
- name: Install Python
57+
uses: actions/setup-python@v5
58+
with:
59+
python-version: ${{matrix.pyth-version}}
60+
- name: Building the projects and running the Test Cases
61+
run: |
62+
python --version
63+
python -m pip install --upgrade pip
64+
python -m venv ve
65+
if [[ "$(uname -s)" == "Linux" ]]; then
66+
echo "In LINUX"
67+
source ve/bin/activate
68+
elif [[ "$(uname -s)" == "Darwin" ]]; then
69+
echo "In MAC"
70+
source ve/bin/activate
71+
else
72+
echo "In Windows"
73+
source ve/Scripts/activate
74+
fi
75+
echo $VIRTUAL_ENV
76+
cd $CLIENT_FOLDER
77+
pip install -e .
78+
cd ..
79+
echo $VIRTUAL_ENV
80+
cd $SAMPLE_FOLDER
81+
pip install -e .
82+
bash ./sample_code_runner.sh
83+
- name: Using Report Generation Action
84+
id: report-generation
85+
uses: ./cybersource-rest-client-python/.github/actions/generate-report
86+
with:
87+
lang: python
88+
sample-folder-name: ${{env.SAMPLE_FOLDER}}
89+
log-file-name: output.log
90+
- name: Upload Test Reports
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: sample-run-report-${{matrix.operating-system}}-python-ver-${{matrix.pyth-version}}
94+
path: |
95+
${{env.SAMPLE_FOLDER}}/${{steps.report-generation.outputs.result-pdf-name}}

0 commit comments

Comments
 (0)