-
Notifications
You must be signed in to change notification settings - Fork 2
127 lines (111 loc) · 3.78 KB
/
test.yaml
File metadata and controls
127 lines (111 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: 'Run Tests'
on:
pull_request:
branches:
- main
jobs:
run-tests:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
runs-on: ${{matrix.os}}
name: '${{matrix.os}} Python ${{matrix.python-version}}'
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.6.0
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
shell: bash
run: |
python3 -m pip install --upgrade pip
- name: Install pystackql with all dependencies
run: |
pip install -e .
- name: Install test dependencies
run: |
pip install pytest>=6.2.5 pytest-cov>=2.12.0 nose>=1.3.7
- name: setup-stackql
uses: stackql/setup-stackql@v2.2.3
with:
use_wrapper: true
- name: Show stackql version (Linux/macOS)
if: matrix.os != 'windows-latest'
shell: bash
run: |
stackql --version
- name: Show stackql version (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: |
stackql-bin.exe --version
- name: Move stackql binary to temp dir (Linux/macOS)
if: matrix.os != 'windows-latest'
shell: bash
run: |
STACKQL_PATH=$(which stackql)
mkdir -p /tmp || true
cp "$STACKQL_PATH" /tmp/stackql
echo "StackQL binary moved from ${STACKQL_PATH} to /tmp/stackql"
- name: Move stackql binary to temp dir (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
$bin = Join-Path $Env:STACKQL_CLI_PATH 'stackql-bin.exe'
if (-Not (Test-Path $bin)) {
throw "Binary not found at $bin"
}
Copy-Item $bin -Destination "C:\Temp\stackql.exe" -Force
Write-Host "Moved real StackQL binary to C:\Temp\stackql.exe"
- name: Run non-server tests
env:
GITHUB_ACTIONS: 'true'
run: |
python3 run_tests.py
- name: Start StackQL server and run tests (Linux/macOS)
if: matrix.os != 'windows-latest'
shell: bash
env:
GITHUB_ACTIONS: 'true'
run: |
nohup /tmp/stackql -v --pgsrv.port=5466 srv &
sleep 5
python3 run_server_tests.py
- name: Start StackQL server (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Start-Process -FilePath "C:\Temp\stackql.exe" `
-ArgumentList "-v", "--pgsrv.port=5466", "srv"
Start-Sleep -Seconds 5
- name: Stop StackQL server (Linux/macOS)
if: matrix.os != 'windows-latest'
shell: bash
run: |
echo "Stopping StackQL server on Unix/macOS..."
PID=$(pgrep -f "/tmp/stackql.*srv" || pgrep -f "stackql.*srv" || echo "")
if [ -z "$PID" ]; then
echo "No stackql server process found."
else
echo "stopping stackql server (PID: $PID)..."
kill -9 $PID
echo "stackql server stopped."
fi
- name: Stop StackQL server (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: |
echo "Stopping StackQL server on Windows..."
taskkill /F /IM stackql.exe 2>nul || echo "No stackql.exe process found"
echo "StackQL server stopped (Windows)"