|
| 1 | +# Setup and SDK reference: https://local.cloud/docs/github-actions/ |
| 2 | +# Laptop: python3 scripts/localcloud-test.py (add --full-suite for regression tests). |
| 3 | +name: pr-local-cloud-integration-tests |
| 4 | +'on': |
| 5 | + pull_request: |
| 6 | + types: |
| 7 | + - opened |
| 8 | + - synchronize |
| 9 | + - reopened |
| 10 | + - labeled |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | +jobs: |
| 14 | + localcloud: |
| 15 | + # Match Feast's approval-label policy and never run this job in fork repositories. |
| 16 | + if: |
| 17 | + ((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) || |
| 18 | + (github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) && |
| 19 | + github.repository == 'feast-dev/feast' |
| 20 | + runs-on: ubuntu-latest |
| 21 | + timeout-minutes: 30 |
| 22 | + services: |
| 23 | + localcloud: |
| 24 | + image: agentcloud/localcloud:ci |
| 25 | + env: |
| 26 | + LOCALCLOUD_SERVICES: bigquery,bigtable,gcs |
| 27 | + LOCALCLOUD_PROJECT: localcloud-ci |
| 28 | + LOCALCLOUD_DOCKER_ACCESS: 'false' |
| 29 | + LOCALCLOUD_TELEMETRY: 'false' |
| 30 | + LOCALCLOUD_CONSOLE: 'false' |
| 31 | + ports: |
| 32 | + - 5380:5380 |
| 33 | + - 5382:5382 |
| 34 | + - 5385:5385 |
| 35 | + - 5388:5388 |
| 36 | + - 5389:5389 |
| 37 | + - 5392:5392 |
| 38 | + options: --memory 4g --health-cmd "curl -fsS http://127.0.0.1:5380/projects |
| 39 | + >/dev/null" --health-interval 5s --health-timeout 5s --health-retries 60 |
| 40 | + --health-start-period 30s |
| 41 | + env: |
| 42 | + LOCALCLOUD_TEST: '1' |
| 43 | + GOOGLE_CLOUD_PROJECT: localcloud-ci |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + - uses: actions/setup-python@v5 |
| 47 | + with: |
| 48 | + python-version: '3.12' |
| 49 | + - uses: actions/setup-go@v5 |
| 50 | + with: |
| 51 | + go-version-file: go.mod |
| 52 | + - uses: astral-sh/setup-uv@v5 |
| 53 | + - name: Set up LocalCloud |
| 54 | + id: localcloud |
| 55 | + uses: agent-local-cloud/setup-localcloud@3f8bd6df58cfd3cf4cd29c46f3449c7e6465f64a |
| 56 | + with: |
| 57 | + image: agentcloud/localcloud:ci |
| 58 | + console: 'false' |
| 59 | + services: bigquery,bigtable,gcs |
| 60 | + project-id: localcloud-ci |
| 61 | + runtime-url: http://127.0.0.1:5380 |
| 62 | + - name: Build project (1) |
| 63 | + run: uv venv --python 3.12 .venv |
| 64 | + working-directory: . |
| 65 | + env: |
| 66 | + LOCALCLOUD_GATEWAY_URL: ${{ steps.localcloud.outputs.runtime-url }} |
| 67 | + - name: Build project (2) |
| 68 | + run: make PYTHON_VERSION=3.12 install-python-dependencies-ci |
| 69 | + working-directory: . |
| 70 | + env: |
| 71 | + LOCALCLOUD_GATEWAY_URL: ${{ steps.localcloud.outputs.runtime-url }} |
| 72 | + - name: Build project (3) |
| 73 | + run: uv pip install protobuf==6.33.6 grpcio-health-checking==1.75.1 grpcio-reflection==1.75.1 |
| 74 | + grpcio-testing==1.75.1 grpcio-tools==1.75.1 |
| 75 | + working-directory: . |
| 76 | + env: |
| 77 | + LOCALCLOUD_GATEWAY_URL: ${{ steps.localcloud.outputs.runtime-url }} |
| 78 | + - name: Build project (4) |
| 79 | + run: .venv/bin/ruff check sdk/python/feast/infra/offline_stores/bigquery.py |
| 80 | + sdk/python/feast/infra/offline_stores/bigquery_source.py sdk/python/tests/localcloud/test_localcloud_gcp.py |
| 81 | + sdk/python/tests/unit/test_bigquery_local_endpoint.py scripts/localcloud-test.py |
| 82 | + working-directory: . |
| 83 | + env: |
| 84 | + LOCALCLOUD_GATEWAY_URL: ${{ steps.localcloud.outputs.runtime-url }} |
| 85 | + - name: Build project (5) |
| 86 | + run: .venv/bin/ruff format --check sdk/python/feast/infra/offline_stores/bigquery.py |
| 87 | + sdk/python/feast/infra/offline_stores/bigquery_source.py sdk/python/tests/localcloud/test_localcloud_gcp.py |
| 88 | + sdk/python/tests/unit/test_bigquery_local_endpoint.py scripts/localcloud-test.py |
| 89 | + working-directory: . |
| 90 | + env: |
| 91 | + LOCALCLOUD_GATEWAY_URL: ${{ steps.localcloud.outputs.runtime-url }} |
| 92 | + - name: Build project (6) |
| 93 | + run: uv pip check |
| 94 | + working-directory: . |
| 95 | + env: |
| 96 | + LOCALCLOUD_GATEWAY_URL: ${{ steps.localcloud.outputs.runtime-url }} |
| 97 | + - name: Build project (7) |
| 98 | + run: git diff --check |
| 99 | + working-directory: . |
| 100 | + env: |
| 101 | + LOCALCLOUD_GATEWAY_URL: ${{ steps.localcloud.outputs.runtime-url }} |
| 102 | + - name: Run LocalCloud tests |
| 103 | + run: .venv/bin/python -m pytest -q --tb=short sdk/python/tests/localcloud/test_localcloud_gcp.py |
| 104 | + working-directory: . |
| 105 | + env: |
| 106 | + LOCALCLOUD_GATEWAY_URL: ${{ steps.localcloud.outputs.runtime-url }} |
0 commit comments