forked from lance-format/lance
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (112 loc) · 3.65 KB
/
Copy pathrecurring-tests.yml
File metadata and controls
121 lines (112 loc) · 3.65 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
name: Recurring Tests
on:
schedule:
- cron: "0 0 * * 0" # Runs at 00:00 UTC every Sunday
workflow_dispatch:
jobs:
get-pylance-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Fetch latest 2 stable pylance versions
id: set-matrix
run: |
# Get all versions from PyPI
pypi_versions=$(curl -s https://pypi.org/pypi/pylance/json | jq -r '.releases | keys_unsorted | .[]')
# Use only PyPI versions
all_versions=$(echo -e "$pypi_versions" | sort -u -V)
# Get latest 2 stable versions
stable_versions=$(echo "$all_versions" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 2)
# Create matrix array
matrix_versions=()
while IFS= read -r version; do
if [ -n "$version" ]; then
matrix_versions+=("$version")
fi
done <<< "$stable_versions"
# Create JSON array manually
json_array="["
for i in "${!matrix_versions[@]}"; do
if [ $i -gt 0 ]; then
json_array="$json_array,"
fi
json_array="$json_array\"${matrix_versions[$i]}\""
done
json_array="$json_array]"
matrix="{\"pylance-version\": $json_array}"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
# This job is used to test the recurring tests on the latest 2 stable versions of Lance,
# and the back-compat of the recurring tests.
recurring-linux:
needs: get-pylance-versions
name: "Recurring: Linux (Pylance ${{ matrix.pylance-version }})"
runs-on: ubuntu-24.04
timeout-minutes: 7200
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-pylance-versions.outputs.matrix) }}
defaults:
run:
shell: bash
working-directory: python
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Install protobuf
run: |
sudo apt update
sudo apt install -y protobuf-compiler
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
working-directory: python
shell: bash
run: |
pip install -e ".[tests]"
- uses: Swatinem/rust-cache@v2
with:
workspaces: python
- name: Install Pylance
run: |
pip install pylance==${{ matrix.pylance-version }}
- name: Run recurring tests
id: run_recurring_tests
run: pytest -vvv -s python/tests/recurring/test_recurring.py
- name: Upgrade Pylance
run: pip install -e ".[tests]"
- name: Run recurring tests again
run: pytest -vvv -s python/tests/recurring/test_recurring.py
# This job is used to test the recurring tests on the main branch.
recurring-linux-fresh-main:
name: "Recurring: Linux (main)"
runs-on: ubuntu-24.04
timeout-minutes: 7200
defaults:
run:
shell: bash
working-directory: python
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Install protobuf
run: |
sudo apt update
sudo apt install -y protobuf-compiler
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: Swatinem/rust-cache@v2
with:
workspaces: python
- name: Install Lance
run: pip install -e ".[tests]"
- name: Run recurring tests
run: pytest -vvv -s python/tests/recurring/test_recurring.py