@@ -13,94 +13,115 @@ jobs:
1313 - windows-latest
1414 - macos-latest
1515 python-version :
16- - " 3.8"
1716 - " 3.9"
1817 - " 3.10"
1918 - " 3.11"
2019 - " 3.12"
2120 - " 3.13"
22- exclude :
23- - os : macos-latest
24- python-version : " 3.8"
25- - os : macos-latest
26- python-version : " 3.13"
2721 runs-on : ${{matrix.os}}
28- name : ' Run Tests on ${{matrix.os}} with Python ${{matrix.python-version}}'
22+ name : ' ${{matrix.os}} Python ${{matrix.python-version}}'
2923
3024 steps :
31- 25+ - name : Checkout
26+ 3227
3328 - name : Set up Python ${{ matrix.python-version }}
34- uses : actions/setup-python@v5.1 .0
29+ uses : actions/setup-python@v5.6 .0
3530 with :
3631 python-version : ${{ matrix.python-version }}
3732
38- - name : Install dependencies from requirements.txt
33+ - name : Upgrade pip
3934 shell : bash
4035 run : |
4136 python3 -m pip install --upgrade pip
42- pip install -r requirements.txt
4337
44- # Windows
45- - name : Install psycopg
46- if : matrix.os == 'windows-latest'
38+ - name : Install pystackql with all dependencies
39+ run : |
40+ pip install -e .
41+
42+ - name : Install test dependencies
4743 run : |
48- pip install psycopg[binary]
49- shell : powershell
50- # End Windows
44+ pip install pytest>=6.2.5 pytest-cov>=2.12.0 nose>=1.3.7
5145
52- # Linux
53- - name : Install PostgreSQL dev libraries on Ubuntu
54- if : matrix.os == 'ubuntu-latest'
46+ - name : setup-stackql
47+ 48+ with :
49+ use_wrapper : true
50+
51+ - name : Show stackql version (Linux/macOS)
52+ if : matrix.os != 'windows-latest'
53+ shell : bash
5554 run : |
56- sudo apt-get update
57- pip install psycopg
58- # End Linux
55+ stackql --version
5956
60- # macOS
61- - name : Install PostgreSQL dev libraries on macOS
62- if : matrix.os == 'macos-latest'
57+ - name : Show stackql version (Windows)
58+ if : matrix.os == 'windows-latest'
59+ shell : cmd
6360 run : |
64- brew install postgresql@14
65- pip install psycopg
66- # End macOS
61+ stackql-bin.exe --version
6762
68- - name : Install pystackql
63+ - name : Move stackql binary to temp dir (Linux/macOS)
64+ if : matrix.os != 'windows-latest'
65+ shell : bash
66+ run : |
67+ STACKQL_PATH=$(which stackql)
68+ mkdir -p /tmp || true
69+ cp "$STACKQL_PATH" /tmp/stackql
70+ echo "StackQL binary moved from ${STACKQL_PATH} to /tmp/stackql"
71+
72+ - name : Move stackql binary to temp dir (Windows)
73+ if : matrix.os == 'windows-latest'
74+ shell : pwsh
6975 run : |
70- pip install .
76+ $bin = Join-Path $Env:STACKQL_CLI_PATH 'stackql-bin.exe'
77+ if (-Not (Test-Path $bin)) {
78+ throw "Binary not found at $bin"
79+ }
80+ Copy-Item $bin -Destination "C:\Temp\stackql.exe" -Force
81+ Write-Host "Moved real StackQL binary to C:\Temp\stackql.exe"
7182
72- - name : Run tests
83+ - name : Run non-server tests
7384 env :
74- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
75- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
76- GOOGLE_CREDENTIALS : ${{ secrets.GOOGLE_CREDENTIALS }}
77- STACKQL_GITHUB_USERNAME : ${{ secrets.STACKQL_GITHUB_USERNAME }}
78- STACKQL_GITHUB_PASSWORD : ${{ secrets.STACKQL_GITHUB_PASSWORD }}
79- CUSTOM_STACKQL_GITHUB_USERNAME : ${{ secrets.CUSTOM_STACKQL_GITHUB_USERNAME }}
80- CUSTOM_STACKQL_GITHUB_PASSWORD : ${{ secrets.CUSTOM_STACKQL_GITHUB_PASSWORD }}
81- AWS_REGION : ${{ vars.AWS_REGION }}
82- AWS_REGIONS : ${{ vars.AWS_REGIONS }}
83- GCP_PROJECT : ${{ vars.GCP_PROJECT }}
84- GCP_ZONE : ${{ vars.GCP_ZONE }}
85+ GITHUB_ACTIONS : ' true'
8586 run : |
86- python3 -m tests.pystackql_tests
87- shell : bash
88- if : matrix.os != 'windows-latest'
87+ python3 run_tests.py
8988
90- - name : Run tests on Windows
89+ - name : Start StackQL server and run tests (Linux/macOS)
90+ if : matrix.os != 'windows-latest'
91+ shell : bash
9192 env :
92- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
93- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
94- GOOGLE_CREDENTIALS : ${{ secrets.GOOGLE_CREDENTIALS }}
95- STACKQL_GITHUB_USERNAME : ${{ secrets.STACKQL_GITHUB_USERNAME }}
96- STACKQL_GITHUB_PASSWORD : ${{ secrets.STACKQL_GITHUB_PASSWORD }}
97- CUSTOM_STACKQL_GITHUB_USERNAME : ${{ secrets.CUSTOM_STACKQL_GITHUB_USERNAME }}
98- CUSTOM_STACKQL_GITHUB_PASSWORD : ${{ secrets.CUSTOM_STACKQL_GITHUB_PASSWORD }}
99- AWS_REGION : ${{ vars.AWS_REGION }}
100- AWS_REGIONS : ${{ vars.AWS_REGIONS }}
101- GCP_PROJECT : ${{ vars.GCP_PROJECT }}
102- GCP_ZONE : ${{ vars.GCP_ZONE }}
93+ GITHUB_ACTIONS : ' true'
10394 run : |
104- python3 -m tests.pystackql_tests
95+ nohup /tmp/stackql -v --pgsrv.port=5466 srv &
96+ sleep 5
97+ python3 run_server_tests.py
98+
99+ - name : Start StackQL server (Windows)
100+ if : matrix.os == 'windows-latest'
105101 shell : pwsh
102+ run : |
103+ Start-Process -FilePath "C:\Temp\stackql.exe" `
104+ -ArgumentList "-v", "--pgsrv.port=5466", "srv"
105+ Start-Sleep -Seconds 5
106+
107+ - name : Stop StackQL server (Linux/macOS)
108+ if : matrix.os != 'windows-latest'
109+ shell : bash
110+ run : |
111+ echo "Stopping StackQL server on Unix/macOS..."
112+ PID=$(pgrep -f "/tmp/stackql.*srv" || pgrep -f "stackql.*srv" || echo "")
113+ if [ -z "$PID" ]; then
114+ echo "No stackql server process found."
115+ else
116+ echo "stopping stackql server (PID: $PID)..."
117+ kill -9 $PID
118+ echo "stackql server stopped."
119+ fi
120+
121+ - name : Stop StackQL server (Windows)
106122 if : matrix.os == 'windows-latest'
123+ shell : cmd
124+ run : |
125+ echo "Stopping StackQL server on Windows..."
126+ taskkill /F /IM stackql.exe 2>nul || echo "No stackql.exe process found"
127+ echo "StackQL server stopped (Windows)"
0 commit comments