-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Does a bit of refactoring to make our GHA jobs much more maintainable: * Pulls common setup code into a composite action to reduce a _lot_ of duplication * Consolidates multiple workflows into a single workflow that responds to multiple events * Deletes two long-failing workflows that aren't used anymore * Simplifies and localizes the commands that run the unit tests * Deletes some unneeded files in the project root * Cleans up some naming for improved readability in the Actions list Also fixes a bug: apparently the Python unit tests haven't even been running! 🙀 Before: ``` Ran 0 tests in 0.000s ``` Now: ``` 3 passed, 3 warnings in 0.36s ``` Fixes #1661.
- Loading branch information
Showing
15 changed files
with
422 additions
and
2,764 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
name: Set up the environment | ||
description: Sets up the current environment by installing tools and dependencies and authenticating with cloud providers. | ||
|
||
inputs: | ||
aws-access-key-id: | ||
required: true | ||
|
||
aws-secret-access-key: | ||
required: true | ||
|
||
aws-role-to-assume: | ||
required: true | ||
|
||
aws-region: | ||
default: us-west-2 | ||
|
||
aws-role-duration-seconds: | ||
default: 7200 | ||
|
||
aws-role-session-name: | ||
default: examples@github-actions | ||
|
||
google-service-account-email: | ||
default: [email protected] | ||
|
||
google-project-name: | ||
default: pulumi-ci-gcp-provider | ||
|
||
google-project-number: | ||
default: 895284651812 | ||
|
||
google-workload-identity-pool: | ||
default: pulumi-ci | ||
|
||
google-workload-identity-provider: | ||
default: pulumi-ci | ||
|
||
google-region: | ||
default: us-central1 | ||
|
||
google-zone: | ||
default: us-central1-a | ||
|
||
github-token: | ||
required: true | ||
|
||
node-version: | ||
default: 18 | ||
|
||
python-version: | ||
default: 3.8 | ||
|
||
go-version: | ||
default: 1.21 | ||
|
||
dotnet-version: | ||
default: 6 | ||
|
||
gotestfmt-version: | ||
default: v2.5.0 | ||
|
||
pulumi-version: | ||
default: dev | ||
|
||
outputs: | ||
aws-access-key-id: | ||
value: ${{ steps.aws-auth.outputs.aws-access-key-id }} | ||
|
||
aws-secret-access-key: | ||
value: ${{ steps.aws-auth.outputs.aws-secret-access-key }} | ||
|
||
aws-session-token: | ||
value: ${{ steps.aws-auth.outputs.aws-session-token }} | ||
|
||
aws-region: | ||
value: ${{ inputs.aws-region }} | ||
|
||
google-project-name: | ||
value: ${{ inputs.google-project-name }} | ||
|
||
google-region: | ||
value: ${{ inputs.google-region }} | ||
|
||
google-zone: | ||
value: ${{ inputs.google-zone}} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{inputs.dotnet-version}} | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{inputs.node-version}} | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{inputs.python-version}} | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{inputs.go-version}} | ||
cache-dependency-path: "**/go.sum" | ||
|
||
- name: Install aws-iam-authenticator | ||
run: | | ||
curl https://amazon-eks.s3-us-west-2.amazonaws.com/1.13.7/2019-06-11/bin/linux/amd64/aws-iam-authenticator -o aws-iam-authenticator | ||
chmod +x ./aws-iam-authenticator | ||
sudo mv aws-iam-authenticator /usr/local/bin | ||
shell: bash | ||
|
||
- name: Install Kubectl | ||
run: | | ||
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | ||
chmod +x ./kubectl | ||
sudo mv kubectl /usr/local/bin | ||
shell: bash | ||
|
||
- name: Install and configure Helm | ||
run: | | ||
curl -o- -L https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash | ||
helm init -c | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
shell: bash | ||
|
||
- name: Install testing dependencies | ||
run: make ensure | ||
shell: bash | ||
|
||
- name: Install gotestfmt | ||
uses: GoTestTools/gotestfmt-action@v2 | ||
with: | ||
version: ${{ inputs.gotestfmt-version }} | ||
token: ${{ inputs.github-token }} | ||
|
||
- name: Install Pulumi | ||
uses: pulumi/actions@v5 | ||
with: | ||
pulumi-version: ${{ inputs.pulumi-version }} | ||
|
||
- run: echo "Pulumi $(pulumi version) is installed" | ||
shell: bash | ||
|
||
- name: Authenticate with AWS | ||
id: aws-auth | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ inputs.aws-access-key-id }} | ||
aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | ||
aws-region: ${{ inputs.aws-region }} | ||
role-to-assume: ${{ inputs.aws-role-to-assume }} | ||
role-duration-seconds: ${{ inputs.role-duration-seconds }} | ||
role-session-name: ${{ inputs.role-session-name }} | ||
unset-current-credentials: true | ||
output-credentials: true | ||
|
||
- name: Authenticate with Google Cloud | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
service_account: ${{ inputs.google-service-account-email }} | ||
workload_identity_provider: projects/${{ inputs.google-project-number }}/locations/global/workloadIdentityPools/${{ inputs.google-workload-identity-pool }}/providers/${{ inputs.google-workload-identity-provider }} | ||
|
||
- name: Install gcloud auth | ||
uses: google-github-actions/setup-gcloud@v2 | ||
with: | ||
install_components: gke-gcloud-auth-plugin | ||
|
||
- name: Configure gcloud CLI | ||
run: | | ||
gcloud config set disable_prompts true | ||
shell: bash | ||
|
||
- name: Authenticate with Google Cloud Registry | ||
run: gcloud --quiet auth configure-docker | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.