Recurring Tests #36
This file contains hidden or 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: 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 |