Acceptance #15
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: Acceptance | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: acceptance-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| durable-resource: | |
| name: ${{ matrix.name }} acceptance | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Browser pool | |
| package: ./internal/resources/browserpool | |
| project_id_required: true | |
| - name: Project | |
| package: ./internal/resources/project | |
| project_id_required: false | |
| - name: Project data source | |
| package: ./internal/datasources/project | |
| project_id_required: true | |
| - name: Profile data source | |
| package: ./internal/datasources/profile | |
| project_id_required: true | |
| - name: Proxy data source | |
| package: ./internal/datasources/proxy | |
| project_id_required: true | |
| - name: Extension data source | |
| package: ./internal/datasources/extension | |
| project_id_required: true | |
| # Keep the job timeout above the go test timeout so Go can report the test | |
| # timeout before the runner stops the job. Either hard timeout can bypass | |
| # t.Cleanup, so release operators still inspect for leaked test resources. | |
| timeout-minutes: 40 | |
| env: | |
| TF_ACC: "1" | |
| KERNEL_ACC: "1" | |
| steps: | |
| - name: Check API key secret | |
| env: | |
| KERNEL_API_KEY: ${{ secrets.KERNEL_API_KEY }} | |
| run: | | |
| : "${KERNEL_API_KEY:?Set the KERNEL_API_KEY repository secret before running acceptance tests.}" | |
| - name: Check project secret | |
| if: matrix.project_id_required | |
| env: | |
| KERNEL_PROJECT_ID: ${{ secrets.KERNEL_PROJECT_ID }} | |
| run: | | |
| : "${KERNEL_PROJECT_ID:?Set the KERNEL_PROJECT_ID repository secret before running browser-pool acceptance tests.}" | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Set up Terraform | |
| uses: hashicorp/setup-terraform@v4 | |
| with: | |
| terraform_version: "1.15.5" | |
| terraform_wrapper: false | |
| - name: Run acceptance tests | |
| env: | |
| KERNEL_API_KEY: ${{ secrets.KERNEL_API_KEY }} | |
| KERNEL_BASE_URL: ${{ secrets.KERNEL_BASE_URL }} | |
| KERNEL_PROJECT_ID: ${{ matrix.project_id_required && secrets.KERNEL_PROJECT_ID || '' }} | |
| KERNEL_ALT_PROJECT_ID: ${{ matrix.project_id_required && secrets.KERNEL_ALT_PROJECT_ID || '' }} | |
| run: | | |
| if [ -z "$KERNEL_BASE_URL" ]; then | |
| unset KERNEL_BASE_URL | |
| fi | |
| go test -count=1 -timeout=30m -v ${{ matrix.package }} -run TestAcc |