Skip to content

Commit

Permalink
Adding workflow to test SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
gnongsie committed Jul 10, 2024
1 parent c412785 commit 9103442
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/python-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Authorize.net Python CI
on:
push:
pull_request:
workflow_dispatch:
env:
sdk_python: 'sdk-python'
sample_code_python: 'sample-code-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:
- name: Creating separate folders for SDK and Sample Codes
run: |
rm -rf $sdk_python
rm -rf $sample_code_python
mkdir $sdk_python $sample_code_python
- name: Checkout authorizenet/sdk-python
uses: actions/checkout@v4
with:
path: ${{env.sdk_python}}

- name: Checkout authorizenet/sample-code-python
uses: actions/checkout@v4
with:
repository: 'authorizenet/sample-code-python'
ref: 'future' # Remove this line before pushing to master branch
path: ${{env.sample_code_python}}

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.pyth-version}}

- name: Install and Test
run: |
python -V
python -m pip install --upgrade pip
python -m venv virtual_env
if [[ "$(uname -s)" == "Linux" ]]; then
echo "OS: Linux"
source virtual_env/bin/activate
elif [[ "$(uname -s)" == "Darwin" ]]; then
echo "OS: MacOS"
source virtual_env/bin/activate
else
echo "OS: Windows"
source virtual_env/Scripts/activate
fi
echo $VIRTUAL_ENV
cd $sdk_python
pip install -e .
cd ../$sample_code_python
python ./test-runner.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
packages/

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down

0 comments on commit 9103442

Please sign in to comment.