ci: run integration tests against N, N-1, N-2 Dapr runtime versions #352
Workflow file for this run
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: run-tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - feature/* | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: | |
| - main | |
| - release-* | |
| - feature/* | |
| workflow_dispatch: | |
| inputs: | |
| daprdapr_commit: | |
| description: 'Dapr/Dapr commit to build custom daprd from' | |
| required: false | |
| default: '' | |
| daprcli_commit: | |
| description: 'Dapr/CLI commit to build custom dapr CLI from' | |
| required: false | |
| default: '' | |
| repository_dispatch: | |
| types: [validate-examples] | |
| merge_group: | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| env: | |
| CHECKOUT_REPO: ${{ github.repository }} | |
| CHECKOUT_REF: ${{ github.ref }} | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - name: Parse repository_dispatch payload | |
| if: github.event_name == 'repository_dispatch' | |
| run: | | |
| if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then | |
| echo "CHECKOUT_REPO=${{ github.event.client_payload.pull_head_repo }}" >> $GITHUB_ENV | |
| echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV | |
| fi | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ${{ env.CHECKOUT_REPO }} | |
| ref: ${{ env.CHECKOUT_REF }} | |
| - name: Compute compatibility test matrix | |
| id: set-matrix | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: python tools/compute_compat_matrix.py | |
| validate: | |
| needs: prepare | |
| runs-on: ubuntu-latest | |
| env: | |
| CHECKOUT_REPO: ${{ github.repository }} | |
| CHECKOUT_REF: ${{ github.ref }} | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} | |
| steps: | |
| - name: Parse repository_dispatch payload | |
| if: github.event_name == 'repository_dispatch' | |
| run: | | |
| if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then | |
| echo "CHECKOUT_REPO=${{ github.event.client_payload.pull_head_repo }}" >> $GITHUB_ENV | |
| echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV | |
| fi | |
| - name: Check out code onto GOPATH | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ${{ env.CHECKOUT_REPO }} | |
| ref: ${{ env.CHECKOUT_REF }} | |
| - name: Set up Python ${{ matrix.python_ver }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python_ver }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: uv sync --frozen --all-packages --group tests | |
| - name: Set up Dapr CLI | |
| uses: dapr/.github/.github/actions/setup-dapr-cli@main | |
| with: | |
| commit: ${{ github.event.inputs.daprcli_commit }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Dapr runtime ${{ matrix.runtime_version }} | |
| uses: dapr/.github/.github/actions/setup-dapr-runtime@main | |
| with: | |
| version: ${{ matrix.runtime_version }} | |
| commit: ${{ github.event.inputs.daprdapr_commit }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Llama | |
| run: | | |
| curl -fsSL https://ollama.com/install.sh | sh | |
| nohup ollama serve & | |
| sleep 10 | |
| ollama pull llama3.2:latest | |
| - name: Run integration tests | |
| run: | | |
| uv run pytest tests/integration/ | |
| - name: Validate examples | |
| run: | | |
| uv run pytest tests/examples/ |