Skip to content

Turn on test sharding for k8s and docker-build #123

Turn on test sharding for k8s and docker-build

Turn on test sharding for k8s and docker-build #123

on:
pull_request:
branches:
- master
env:
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Verify against testdata
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v6
with:
working-directory: provider-ci
- name: Configure git
# Set the default branch to silence the warnings about the default branch name changing
# The branch doesn't matter here because it's only used for a temp repo for actionlint
run: git config --global init.defaultBranch master
- name: Build & test
run: cd provider-ci && make all
- name: Check worktree clean
uses: pulumi/git-status-check-action@v1
deploy:
uses: ./.github/workflows/update-workflows.yml
secrets: inherit
with:
bridged: true
provider_name: xyz
automerge: false
downstream_test: true
skip_closing_prs: true
caller_workflow: "pull-request"
downstream:
name: Test xyz
timeout-minutes: 240
runs-on: ubuntu-latest
needs: deploy
if: needs.deploy.outputs.pull_request_created == 'true'
env:
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
strategy:
fail-fast: false
steps:
- name: Await PR opened for pulumi-xyz
run: |
echo Await PR opened for pulumi-xyz
until gh search prs --repo pulumi/pulumi-xyz --match body "This PR was automatically generated by the pull-request workflow in the pulumi/ci-mgmt repo, from commit ${{ github.sha }}." --json url | grep url; do sleep 30; done;
- name: Find PR number
id: pr_number
run: |
number=$(gh search prs --repo pulumi/pulumi-xyz --match body "This PR was automatically generated by the pull-request workflow in the pulumi/ci-mgmt repo, from commit ${{ github.sha }}." --json number --jq '.[0].number')
echo "PR number is $number"
echo "number=${number}" >> "${GITHUB_OUTPUT}"
- name: Await first checks started
# Wait for at least 3 checks to be started before we start waiting for them to finish.
# There's a couple of quick checks like comment notification and changelog which are started before the PR checks.
run: while [[ $(gh pr checks --repo "pulumi/pulumi-xyz" "${{ steps.pr_number.outputs.number }}" | wc -l) -le 2 ]]; do sleep 1; done
- name: Await PR codegen tests succeed.
run: gh pr checks --repo "pulumi/pulumi-xyz" "${{ steps.pr_number.outputs.number }}" --watch --fail-fast