Feature/refactor #43
Workflow file for this run
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: 'Run Tests' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
run-tests: | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
python-version: | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
# - "3.12" | |
runs-on: ${{matrix.os}} | |
name: 'Run Tests' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies from requirements.txt | |
shell: bash | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Install psycopg2 for non-Windows OS | |
if: matrix.os != 'windows-latest' | |
run: | | |
pip install psycopg2 | |
# Windows specific | |
- name: Determine psycopg2 wheel filename for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
if ("${{ matrix.python-version }}" -eq "3.7") { echo "WHEEL_FILENAME=psycopg2-2.9.3-cp37-cp37m-win_amd64.whl" >> $GITHUB_ENV } | |
elseif ("${{ matrix.python-version }}" -eq "3.8") { echo "WHEEL_FILENAME=psycopg2-2.9.3-cp38-cp38-win_amd64.whl" >> $GITHUB_ENV } | |
elseif ("${{ matrix.python-version }}" -eq "3.9") { echo "WHEEL_FILENAME=psycopg2-2.9.3-cp39-cp39-win_amd64.whl" >> $GITHUB_ENV } | |
elseif ("${{ matrix.python-version }}" -eq "3.10") { echo "WHEEL_FILENAME=psycopg2-2.9.3-cp310-cp310-win_amd64.whl" >> $GITHUB_ENV } | |
elseif ("${{ matrix.python-version }}" -eq "3.11") { echo "WHEEL_FILENAME=psycopg2-2.9.3-cp311-cp311-win_amd64.whl" >> $GITHUB_ENV } | |
shell: powershell | |
- name: Download psycopg2 wheel file for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
Invoke-WebRequest -Uri https://download.lfd.uci.edu/pythonlibs/archived/${{ env.WHEEL_FILENAME }} -OutFile ${{ env.WHEEL_FILENAME }} | |
shell: powershell | |
- name: Install psycopg2-binary for Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
pip install ./${{ env.WHEEL_FILENAME }} | |
# End Windows specific | |
- name: Install pystackql | |
run: | | |
pip install . | |
- name: Run tests | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} | |
AWS_REGIONS: ${{ vars.AWS_REGIONS }} | |
GCP_PROJECT: ${{ vars.GCP_PROJECT }} | |
GCP_ZONE: ${{ vars.GCP_ZONE }} | |
run: | | |
python3 -m tests.pystackql_tests |