Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test job #13618

Merged
merged 6 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/scheduled-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@ env:
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
GOOGLE_CI_SERVICE_ACCOUNT_EMAIL: [email protected]
GOOGLE_CI_WORKLOAD_IDENTITY_POOL: pulumi-ci
GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER: pulumi-ci
GOOGLE_PROJECT: pulumi-ci-gcp-provider
GOOGLE_PROJECT_NUMBER: 895284651812

jobs:
test:
runs-on: ${{ matrix.platform }}
permissions:
contents: read
id-token: write
strategy:
matrix:
platform:
Expand Down Expand Up @@ -80,5 +88,11 @@ jobs:
role-session-name: pulumi-docs-examples@githubActions
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER }}/locations/global/workloadIdentityPools/${{ env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }}

- name: Run the tests
run: make test
33 changes: 30 additions & 3 deletions scripts/programs/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ else
org="$(pulumi whoami -v --json | jq -r .user)"
fi

failed_projects=()
passing_projects=()

pushd "$programs_dir"
found_first_program=false

Expand Down Expand Up @@ -69,7 +72,10 @@ pushd "$programs_dir"
fqsn="${org}/${project}/${stack}"

# Install dependencies.
pulumi -C "$project" install
if ! pulumi -C "$project" install; then
failed_projects+=("$project")
continue
fi

# Skip programs we know don't successfully preview.

Expand Down Expand Up @@ -117,9 +123,15 @@ pushd "$programs_dir"
continue
fi

pulumi -C "$project" up --yes
if ! pulumi -C "$project" up --yes; then
failed_projects+=("$project")
continue
fi
else
pulumi -C "$project" preview
if ! pulumi -C "$project" preview; then
failed_projects+=("$project")
continue
fi
fi

# Destroy and remove.
Expand All @@ -137,3 +149,18 @@ if [[ "$mode" == "preview" ]]; then
unset PULUMI_CONFIG_PASSPHRASE
pulumi logout --local
fi

# Report passing and failing projects.
if [ ${#failed_projects[@]} -ne 0 ]; then
echo "The following projects failed:"
for project in "${failed_projects[@]}"; do
echo "- $project"
done
echo "The following projects passed:"
for project in "${passing_projects[@]}"; do
echo "- $project"
done
exit 1
else
echo "All projects completed successfully :)"
fi
Loading