diff --git a/.github/workflows/integration-cloud.yml b/.github/workflows/integration-cloud.yml index 3f028465..cff2868e 100644 --- a/.github/workflows/integration-cloud.yml +++ b/.github/workflows/integration-cloud.yml @@ -5,6 +5,7 @@ on: push: branches: - master + - thomasht86/fix-integrationtest-vectorsearch schedule: - cron: "0 11 * * 0" @@ -13,20 +14,58 @@ concurrency: cancel-in-progress: false jobs: + setup-environment: + runs-on: ubuntu-latest + outputs: + python-cache-key: ${{ steps.cache-python.outputs.cache-hit }} + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + id: setup-python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Cache dependencies + id: cache-python + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} + + - name: Install dependencies + if: steps.cache-python.outputs.cache-hit != 'true' + run: | + pip install -e .[dev] + + - name: Upload Python environment + uses: actions/upload-artifact@v3 + with: + name: python-environment + path: ~/.cache/pip + integration-cloud: runs-on: ubuntu-latest + needs: setup-environment steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" - cache: "pip" - cache-dependency-path: | - pyproject.toml + python-version: "3.10" + + - name: Download Python environment + uses: actions/download-artifact@v3 + with: + name: python-environment + path: ~/.cache/pip + - name: Install dependencies run: | pip install -e .[dev] + - name: Run integration tests env: VESPA_TEAM_API_KEY: ${{ secrets.VESPA_TEAM_API_KEY }} @@ -35,42 +74,54 @@ jobs: integration-cloud-token: runs-on: ubuntu-latest - needs: integration-cloud + needs: setup-environment steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" - cache: "pip" - cache-dependency-path: | - pyproject.toml + python-version: "3.10" + + - name: Download Python environment + uses: actions/download-artifact@v3 + with: + name: python-environment + path: ~/.cache/pip + - name: Install dependencies run: | pip install -e .[dev] + - name: Run integration tests env: VESPA_TEAM_API_KEY: ${{ secrets.VESPA_TEAM_API_KEY }} VESPA_CLOUD_SECRET_TOKEN: ${{ secrets.VESPA_CLOUD_SECRET_TOKEN }} - VESPA_CLIENT_TOKEN_ID: ${{ secrets.VESPA_CLIENT_TOKEN_ID}} + VESPA_CLIENT_TOKEN_ID: ${{ secrets.VESPA_CLIENT_TOKEN_ID }} run: | pytest tests/integration/test_integration_vespa_cloud_token.py -s -v integration-cloud-vector-search: runs-on: ubuntu-latest - needs: integration-cloud-token + needs: setup-environment steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" - cache: "pip" - cache-dependency-path: | - pyproject.toml + python-version: "3.10" + + - name: Download Python environment + uses: actions/download-artifact@v3 + with: + name: python-environment + path: ~/.cache/pip + - name: Install dependencies run: | pip install -e .[dev] + - name: Run integration tests env: VESPA_TEAM_API_KEY: ${{ secrets.VESPA_TEAM_API_KEY }}