1+ name : Authorize.net Python CI
2+ on :
3+ push :
4+ pull_request :
5+ workflow_dispatch :
6+ env :
7+ sdk_python : ' sdk-python'
8+ sample_code_python : ' sample-code-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+ - name : Creating separate folders for SDK and Sample Codes
36+ run : |
37+ rm -rf $sdk_python
38+ rm -rf $sample_code_python
39+ mkdir $sdk_python $sample_code_python
40+
41+ - name : Checkout authorizenet/sdk-python
42+ uses : actions/checkout@v4
43+ with :
44+ path : ${{env.sdk_python}}
45+
46+ - name : Checkout authorizenet/sample-code-python
47+ uses : actions/checkout@v4
48+ with :
49+ repository : ' authorizenet/sample-code-python'
50+ ref : ' future' # Remove this line before pushing to master branch
51+ path : ${{env.sample_code_python}}
52+
53+ - name : Install Python
54+ uses : actions/setup-python@v5
55+ with :
56+ python-version : ${{matrix.pyth-version}}
57+
58+ - name : Install and Test
59+ run : |
60+ python -V
61+ python -m pip install --upgrade pip
62+ python -m venv virtual_env
63+ if [[ "$(uname -s)" == "Linux" ]]; then
64+ echo "OS: Linux"
65+ source virtual_env/bin/activate
66+ elif [[ "$(uname -s)" == "Darwin" ]]; then
67+ echo "OS: MacOS"
68+ source virtual_env/bin/activate
69+ else
70+ echo "OS: Windows"
71+ source virtual_env/Scripts/activate
72+ fi
73+ echo $VIRTUAL_ENV
74+
75+ cd $sdk_python
76+ pip install -e .
77+
78+ cd ../$sample_code_python
79+ python ./test-runner.py
0 commit comments