1+ name: 'Run Async Server Tests'
2+ on:
3+ pull_request:
4+ branches:
5+ - main
6+
7+ jobs:
8+ run-tests:
9+ strategy:
10+ matrix:
11+ os:
12+ - ubuntu-latest
13+ # - windows-latest
14+ # - macos-latest
15+ python-version:
16+ - "3.7"
17+ - "3.8"
18+ - "3.9"
19+ - "3.10"
20+ - "3.11"
21+ - "3.12"
22+ exclude:
23+ - os: windows-latest
24+ python-version: "3.12"
25+ runs-on: ${{matrix.os}}
26+ name: 'Run Tests on ${{matrix.os}} with Python ${{matrix.python-version}}'
27+
28+ steps:
29+ - uses: actions/checkout@v3
30+
31+ - name: Set up Python ${{ matrix.python-version }}
32+ uses: actions/setup-python@v4
33+ with:
34+ python-version: ${{ matrix.python-version }}
35+
36+ - name: Install dependencies from requirements.txt
37+ shell: bash
38+ run: |
39+ python3 -m pip install --upgrade pip
40+ pip install -r requirements.txt
41+
42+ - name: Install psycopg2 for non-Windows OS
43+ if: matrix.os != 'windows-latest'
44+ run: |
45+ pip install psycopg2
46+
47+ # Windows specific
48+ # whl files downloaded from https://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg
49+ - name: Install psycopg2-binary for Windows using local wheel
50+ if: matrix.os == 'windows-latest'
51+ run: |
52+ # Determine the wheel filename based on the Python version
53+ $wheelFilename = switch ("${{ matrix.python-version }}") {
54+ "3.7" { "psycopg2-2.9.3-cp37-cp37m-win_amd64.whl" }
55+ "3.8" { "psycopg2-2.9.3-cp38-cp38-win_amd64.whl" }
56+ "3.9" { "psycopg2-2.9.3-cp39-cp39-win_amd64.whl" }
57+ "3.10" { "psycopg2-2.9.3-cp310-cp310-win_amd64.whl" }
58+ "3.11" { "psycopg2-2.9.3-cp311-cp311-win_amd64.whl" }
59+ }
60+
61+ # Print the wheel filename for debugging
62+ Write-Host "Determined wheel filename: $wheelFilename"
63+
64+ # Install the wheel
65+ pip install ./tests/whls/$wheelFilename
66+ shell: powershell
67+ # End Windows specific
68+
69+ - name: Install pystackql
70+ run: |
71+ pip install .
72+
73+ - name: Run tests
74+ env:
75+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
76+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
77+ GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
78+ AWS_REGIONS: ${{ vars.AWS_REGIONS }}
79+ GCP_PROJECT: ${{ vars.GCP_PROJECT }}
80+ GCP_ZONE: ${{ vars.GCP_ZONE }}
81+ run: |
82+ python3 -m tests.pystackql_async_server_tests
0 commit comments