Updates for 2024 Release #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |