Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding workflows #121

Open
wants to merge 131 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
68aa22c
test commit
aasgoel Jun 6, 2024
c14e644
checking out the python samples inside a new folder python_sdk in wor…
aasgoel Jun 6, 2024
e04cdc3
Update python-workflow.yml
aasgoel Jun 6, 2024
091b428
Updated the workflow for running test on a updateinvoicesettings
aasgoel Jun 7, 2024
01498fd
changed the runner to ubuntu latest in place of ubuntu 24.04
aasgoel Jun 7, 2024
6c87b3f
added one more test to check whether it fails or not
aasgoel Jun 7, 2024
21b9fb2
updated the workflow
aasgoel Jun 7, 2024
b4c736f
adding the lib file to workflow to check will it work
aasgoel Jun 7, 2024
6b53d62
Update python-workflow.yml
aasgoel Jun 7, 2024
074e5ad
Made Changes to the workflow to run test report generation
aasgoel Jun 10, 2024
334249f
Update python-workflow.yml
aasgoel Jun 10, 2024
7722990
Update python-workflow.yml
aasgoel Jun 10, 2024
1c9aa9f
Update python-workflow.yml
aasgoel Jun 10, 2024
8067d58
Update python-workflow.yml
aasgoel Jun 10, 2024
49578ec
Update python-workflow.yml
aasgoel Jun 10, 2024
a1d8bde
removing the Comments and changing the directory to Validation
aasgoel Jun 10, 2024
b58beeb
Update python-workflow.yml
aasgoel Jun 10, 2024
cb5c9ad
Update python-workflow.yml
aasgoel Jun 10, 2024
204c1ee
Update python-workflow.yml
aasgoel Jun 10, 2024
f25115b
Update python-workflow.yml
aasgoel Jun 10, 2024
03011d0
Update python-workflow.yml
aasgoel Jun 10, 2024
122ab44
Update python-workflow.yml
aasgoel Jun 10, 2024
703cb9b
Update python-workflow.yml
aasgoel Jun 10, 2024
d9cb3f6
Update python-workflow.yml
aasgoel Jun 10, 2024
94a8405
Update python-workflow.yml
aasgoel Jun 10, 2024
99ebdcb
Update python-workflow.yml
aasgoel Jun 10, 2024
632674f
Update python-workflow.yml
aasgoel Jun 10, 2024
e02c3f8
Update python-workflow.yml
aasgoel Jun 10, 2024
8e42398
Update python-workflow.yml
aasgoel Jun 10, 2024
64215bb
running the samples and generating the actual report
aasgoel Jun 10, 2024
d5a00e7
Update python-workflow.yml
aasgoel Jun 10, 2024
4cc720b
Update python-workflow.yml
aasgoel Jun 10, 2024
85edc9f
Create python-workflow-window.yml
aasgoel Jun 10, 2024
dd9e8ce
Update python-workflow-window.yml
aasgoel Jun 10, 2024
ff55ce3
Update python-workflow-window.yml
aasgoel Jun 10, 2024
f9e0d14
Update python-workflow-window.yml
aasgoel Jun 10, 2024
6d8d4fa
Update python-workflow-window.yml
aasgoel Jun 10, 2024
b982bae
Update python-workflow-window.yml
aasgoel Jun 10, 2024
0b5a470
Update python-workflow-window.yml
aasgoel Jun 10, 2024
e2289ba
Update python-workflow-window.yml
aasgoel Jun 10, 2024
e89d0ce
Update python-workflow-window.yml
aasgoel Jun 10, 2024
80209da
Update python-workflow-window.yml
aasgoel Jun 10, 2024
e987ee6
Update python-workflow-window.yml
aasgoel Jun 10, 2024
b54c7ef
Update python-workflow-window.yml
aasgoel Jun 10, 2024
5bb5bee
Update python-workflow-window.yml
aasgoel Jun 10, 2024
cdcffdd
Update python-workflow-window.yml
aasgoel Jun 10, 2024
8bdaf8c
Update python-workflow-window.yml
aasgoel Jun 10, 2024
0c242d9
Update python-workflow-window.yml
aasgoel Jun 10, 2024
94250ca
Update python-workflow-window.yml
aasgoel Jun 10, 2024
ce2630a
Update python-workflow-window.yml
aasgoel Jun 10, 2024
dcfe288
Update python-workflow-window.yml
aasgoel Jun 10, 2024
b143997
Update python-workflow-window.yml
aasgoel Jun 10, 2024
f6ef1e1
Update python-workflow-window.yml
aasgoel Jun 10, 2024
8bddbf5
Update python-workflow-window.yml
aasgoel Jun 10, 2024
5ea344e
Update python-workflow-window.yml
aasgoel Jun 10, 2024
8873ed6
Update python-workflow-window.yml
aasgoel Jun 10, 2024
1277a3d
Update python-workflow-window.yml
aasgoel Jun 10, 2024
85cdf48
Update python-workflow.yml
aasgoel Jun 10, 2024
18a539b
Update python-workflow.yml
aasgoel Jun 10, 2024
82d00f4
Changed the Worflow files
aasgoel Jun 10, 2024
1066d65
Update python-workflow-window.yml
aasgoel Jun 10, 2024
c235dcf
adding always to ensure that the other runners don't stop running
aasgoel Jun 10, 2024
cadf486
Update python-workflow-window.yml
aasgoel Jun 10, 2024
cc5f142
Update python-workflow-window.yml
aasgoel Jun 10, 2024
622e56b
Update python-workflow-window.yml
aasgoel Jun 10, 2024
5ddeb5a
Update python-workflow-window.yml
aasgoel Jun 11, 2024
0664a4b
the version xhtml2pdf
aasgoel Jun 11, 2024
b252259
Update python-workflow-window.yml
aasgoel Jun 11, 2024
c9c5e94
Update python-workflow-window.yml
aasgoel Jun 11, 2024
af46ff6
deleted the Old Workflow and added workflow that runs for all three os
aasgoel Jun 12, 2024
b94e2c7
Update the workflow file
aasgoel Jun 14, 2024
991eee4
Update python-workflow.yml
aasgoel Jun 14, 2024
db0312a
Changes to yaml file
aasgoel Jun 14, 2024
1e12f49
Update python-workflow.yml
aasgoel Jun 14, 2024
629c611
Update python-workflow.yml
aasgoel Jun 16, 2024
bd416f5
Update python-workflow.yml
aasgoel Jun 18, 2024
c01f258
Update python-workflow.yml
aasgoel Jun 18, 2024
f189f1f
Update python-workflow.yml
aasgoel Jun 18, 2024
d11445f
Update python-workflow.yml
aasgoel Jun 18, 2024
2afbf42
Update python-workflow.yml
aasgoel Jun 18, 2024
c33efba
Update python-workflow.yml
aasgoel Jun 19, 2024
421ee5e
Update README.md
aasgoel Jun 19, 2024
1f438f3
Update python-workflow.yml
aasgoel Jun 19, 2024
10cdaad
Testing out environmental markers for dependencies
gnongsie Jun 19, 2024
718dcb8
changed ubuntu version from 20.0.4 to 20.04
aasgoel Jun 19, 2024
a10ecfc
Updated the readme file
aasgoel Jun 19, 2024
a6502b5
Renaming the workflow
aasgoel Jun 19, 2024
8c42932
Trying to fix error of openssl on Windows
gnongsie Jun 19, 2024
368f9d4
Changing shell for command
gnongsie Jun 19, 2024
9eb0de1
Adding comment to trigger workflow
aasgoel Jun 21, 2024
8db182e
Update python-workflow.yml
aasgoel Jul 1, 2024
3e8d3d8
Update python-workflow.yml
aasgoel Jul 1, 2024
465e262
Update python-workflow.yml
aasgoel Jul 1, 2024
2049d58
updated comments [no ci]
aasgoel Jul 1, 2024
e3fe97d
Added the custom github action
aasgoel Jul 3, 2024
9c951e2
Update python-workflow.yml
aasgoel Jul 3, 2024
ca3b629
Update python-workflow.yml
aasgoel Jul 3, 2024
e20efee
Update python-workflow.yml
aasgoel Jul 3, 2024
e862b3a
Made changes to the composite action
aasgoel Jul 3, 2024
40de50d
made changes
aasgoel Jul 3, 2024
acf6466
Update python-workflow.yml
aasgoel Jul 3, 2024
0a8fe8e
Update python-workflow.yml
aasgoel Jul 3, 2024
775828b
Update python-workflow.yml
aasgoel Jul 3, 2024
3c98601
Update python-workflow.yml
aasgoel Jul 3, 2024
08eb379
made changes
aasgoel Jul 3, 2024
7fefc33
made changes
aasgoel Jul 3, 2024
007b429
Update action.yml
aasgoel Jul 3, 2024
a709a90
Update action.yml
aasgoel Jul 3, 2024
8a2139b
Update action.yml
aasgoel Jul 3, 2024
a64449a
Update action.yml
aasgoel Jul 3, 2024
a2b3cdb
Update python-workflow.yml
aasgoel Jul 3, 2024
5ed36bc
Update python-workflow.yml
aasgoel Jul 3, 2024
9dd090e
Update python-workflow.yml
aasgoel Jul 3, 2024
827268e
Remoced the Comments and doing a test run
aasgoel Jul 3, 2024
6f859dd
checking with new virtual env
aasgoel Jul 3, 2024
31cd252
Update action.yml
aasgoel Jul 3, 2024
40e6d61
running test with sample code
aasgoel Jul 3, 2024
7d77494
Update python-workflow.yml
aasgoel Jul 3, 2024
93af93d
Merge branch 'master' into adding-workflows
aasgoel Jul 8, 2024
9d193ec
[no ci]
aasgoel Jul 10, 2024
d6d9d9b
Update python-workflow.yml
aasgoel Jul 15, 2024
dbaedf9
Update python-workflow.yml
aasgoel Jul 15, 2024
9aa9b2f
Update python-workflow.yml
aasgoel Jul 15, 2024
836ed6d
Update python-workflow.yml
aasgoel Jul 15, 2024
70a6a11
Update python-workflow.yml
aasgoel Jul 15, 2024
69ef104
Revert "Update python-workflow.yml"
aasgoel Jul 15, 2024
dd81760
Revert "Update python-workflow.yml"
aasgoel Jul 15, 2024
19ee2cd
Revert "Update python-workflow.yml"
aasgoel Jul 15, 2024
cf07b9a
Revert "Update python-workflow.yml"
aasgoel Jul 15, 2024
35b20da
Revert "Update python-workflow.yml"
aasgoel Jul 15, 2024
0e1dc83
Update python-workflow.yml
aasgoel Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/actions/generate-report/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: 'Generate the Report'
description: 'Generates the report using the log-file-name file present just inside the sample folder path provided , given Validation Folder is there inside the sample folder as well'
inputs:
lang:
description: 'The language or framework in which SDK is written needs to be given as an input'
required: true
sample-folder-name:
description: 'The name of the sample folder'
required: true
log-file-name:
description: 'The name of the generated log file'
required: true
outputs:
result-pdf-name:
description: 'the name of the final generated pdf report'
value: ${{steps.generate.outputs.pdfname}}
runs:
using: 'composite'
steps:
- name: Setup Python v3.12 for report generation only
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Installing required python libraries and running the python programs to generate pdf report
id: generate
run : |
export EXPECTED_RES_LANG=${{inputs.lang}}
if [[ "${{inputs.lang}}" == "dotnet" ]] || [[ "${{inputs.lang}}" == "dotnetstandard" ]]; then
export EXPECTED_RES_LANG=csharp
fi
echo $EXPECTED_RES_LANG
python --version
echo "Before Running Report Generation"
cd ${{inputs.sample-folder-name}}
python -m pip install --upgrade pip
python -m venv newve
if [[ "$(uname -s)" == "Linux" ]]; then
echo "In LINUX"
source newve/bin/activate
elif [[ "$(uname -s)" == "Darwin" ]]; then
echo "In MAC"
source newve/bin/activate
else
echo "In Windows"
source newve/Scripts/activate
fi
echo $VIRTUAL_ENV
pip install json2html
pip install xhtml2pdf
pip install bs4
cd Validation
python sample_code_log_processor.py -l ../../${{inputs.sample-folder-name}}/${{inputs.log-file-name}} -o ../../${{inputs.sample-folder-name}}/${{inputs.lang}}_actual_results.json
python response_code_validator.py -e ExpectedResults/${EXPECTED_RES_LANG}_expected_results.json -a ../../${{inputs.sample-folder-name}}/${{inputs.lang}}_actual_results.json -o ${{inputs.lang}}_validation_results.json
python json_to_prettified_html.py -i ${{inputs.lang}}_validation_results.json -o ${{inputs.lang}}_validation_results.html
cp ${{inputs.lang}}_validation_results.pdf ../ #copying the file to flaatten the directory of the upload artifact,Github Actions doesn't support that as of jun 2024
echo "pdfname=${{inputs.lang}}_validation_results.pdf" >> $GITHUB_OUTPUT
shell: bash

95 changes: 95 additions & 0 deletions .github/workflows/python-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: PYTHON BUILDS
on:
push:
pull_request:
workflow_dispatch:
env:
CLIENT_FOLDER: 'cybersource-rest-client-python'
SAMPLE_FOLDER: 'cybersource-rest-samples-python'
jobs:
workflow-job:
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest,macos-latest,windows-latest]
pyth-version: ['3.6','3.7','3.8','3.9','3.10','3.11','3.12']
include:
- operating-system: ubuntu-20.04 # Checking support for ubuntu os with python 3.6
pyth-version: '3.6'
- operating-system: macos-13 # Checking support for mac os with python 3.6
pyth-version: '3.6'
- operating-system: macos-13 # Checking support for mac os with python 3.7
pyth-version: '3.7'
exclude:
- operating-system: ubuntu-latest #arm 64 doesn't support python ver 3.7
pyth-version: '3.6'
- operating-system: macos-latest #arm 64 doesn't support python ver 3.6
pyth-version: '3.6'
- operating-system: macos-latest #arm 64 doesn't support python ver 3.7
pyth-version: '3.7'
runs-on: ${{matrix.operating-system}}
steps:
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
if: runner.os == 'Windows'
shell: pwsh
- run: vcpkg install openssl:x64-windows-static-md
if: runner.os == 'Windows'
shell: pwsh
- name: Creating separate folders for checkout repos
run: |
rm -rf $CLIENT_FOLDER
rm -rf $SAMPLE_FOLDER
mkdir $CLIENT_FOLDER $SAMPLE_FOLDER
- name: Checkout cybersource-rest-client-python repo
uses: actions/checkout@v4
with:
path: ${{env.CLIENT_FOLDER}}
- name: Checkout cybersource-rest-samples-python repo
uses: actions/checkout@v4
with:
repository: 'CyberSource/cybersource-rest-samples-python'
ref: 'master' # this is used for checking out a particular branch in repo
path: ${{env.SAMPLE_FOLDER}}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.pyth-version}}
- name: Building the projects and running the Test Cases
run: |
python --version
python -m pip install --upgrade pip
python -m venv ve
if [[ "$(uname -s)" == "Linux" ]]; then
echo "In LINUX"
source ve/bin/activate
elif [[ "$(uname -s)" == "Darwin" ]]; then
echo "In MAC"
source ve/bin/activate
else
echo "In Windows"
source ve/Scripts/activate
fi
echo $VIRTUAL_ENV
cd $CLIENT_FOLDER
pip install -e .
cd ..
echo $VIRTUAL_ENV
cd $SAMPLE_FOLDER
pip install -e .
bash ./sample_code_runner.sh
- name: Using Report Generation Action
id: report-generation
uses: ./cybersource-rest-client-python/.github/actions/generate-report
with:
lang: python
sample-folder-name: ${{env.SAMPLE_FOLDER}}
log-file-name: output.log
- name: Upload Test Reports
uses: actions/upload-artifact@v4
with:
name: sample-run-report-${{matrix.operating-system}}-python-ver-${{matrix.pyth-version}}
path: |
${{env.SAMPLE_FOLDER}}/${{steps.report-generation.outputs.result-pdf-name}}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

# Python Client SDK for the CyberSource REST API

[![BUILD](https://github.com/CyberSource/cybersource-rest-client-python/actions/workflows/python-workflow.yml/badge.svg?branch=adding-workflows)](https://github.com/CyberSource/cybersource-rest-client-python/actions/workflows/python-workflow.yml)

## Description

The CyberSource Python client provides convenient access to the [CyberSource REST API](https://developer.cybersource.com/api/reference/api-reference.html) from your Python application.
Expand Down
6 changes: 4 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ DateTime
setuptools
six
urllib3
jwcrypto
cryptography
jwcrypto==1.5.1;python_version<="3.7"
jwcrypto>=1.5.6;python_version>"3.7"
cryptography==40.0.2;python_version<="3.6"
cryptography<41.1.0;python_version>"3.6"
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
"setuptools",
"six",
"urllib3",
"jwcrypto",
"cryptography",
"jwcrypto==1.5.1;python_version<='3.7'",
"jwcrypto>=1.5.6;python_version>'3.7'",
"cryptography==40.0.2;python_version<='3.6'",
"cryptography<41.1.0;python_version>'3.6'"
],
packages=find_packages(),
include_package_data=True,
Expand Down
Loading