test sharding

This commit is contained in:
Bryce Lampe
2024-08-12 17:13:09 -07:00
parent c9c5986598
commit 3856050305
3 changed files with 164 additions and 14 deletions

View File

@@ -179,7 +179,7 @@ jobs:
status: ${{ job.status }}
test:
runs-on: pulumi-ubuntu-8core
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
@@ -189,12 +189,7 @@ jobs:
strategy:
fail-fast: true
matrix:
language:
- nodejs
- python
- dotnet
- go
- java
shard: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
@@ -233,7 +228,7 @@ jobs:
run: yarn global add typescript
- run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Install dependencies
run: make install_${{ matrix.language}}_sdk
run: mise run install
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
@@ -254,12 +249,11 @@ jobs:
- name: Setup gcloud auth
uses: google-github-actions/setup-gcloud@v2
with:
install_components: gke-gcloud-auth-plugin
skip_install: true
- name: Shard tests
run: mise run "test:examples:shard" -- -n ${{ strategy.job-total }} --shard ${{ strategy.job-index }} > go-test
- name: Run tests
run: >-
set -euo pipefail
cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
run: mise run "test:examples" $(cat go-test) 2>&1 | tee /tmp/gotest.log | gotestfmt
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3