|
| 1 | +name: CI setup |
| 2 | +description: 'Sets up the environment for jobs during CI workflow' |
| 3 | + |
| 4 | +inputs: |
| 5 | + node-version: |
| 6 | + default: 18.x |
| 7 | + |
| 8 | + python-version: |
| 9 | + default: 3.9 |
| 10 | + |
| 11 | + go-version: |
| 12 | + default: 1.21 |
| 13 | + |
| 14 | + dotnet-version: |
| 15 | + default: 6 |
| 16 | + |
| 17 | + gotestfmt-version: |
| 18 | + default: v2.5.0 |
| 19 | + |
| 20 | + pulumi-version: |
| 21 | + default: dev |
| 22 | + |
| 23 | + google-service-account-email: |
| 24 | + |
| 25 | + |
| 26 | + google-project-number: |
| 27 | + default: google-service-account-email |
| 28 | + |
| 29 | + google-workload-identity-pool: |
| 30 | + default: pulumi-ci |
| 31 | + |
| 32 | + google-workload-identity-provider: |
| 33 | + default: pulumi-ci |
| 34 | + |
| 35 | + aws-access-key-id: |
| 36 | + required: true |
| 37 | + |
| 38 | + aws-secret-access-key: |
| 39 | + required: true |
| 40 | + |
| 41 | + aws-role-to-assume: |
| 42 | + required: true |
| 43 | + |
| 44 | + github-token: |
| 45 | + required: true |
| 46 | + |
| 47 | + aws-region: |
| 48 | + default: us-west-2 |
| 49 | + |
| 50 | + aws-role-duration-seconds: |
| 51 | + default: 7200 |
| 52 | + |
| 53 | + aws-role-session-name: |
| 54 | + default: examples@github-actions |
| 55 | + |
| 56 | +runs: |
| 57 | + using: composite |
| 58 | + steps: |
| 59 | + |
| 60 | + - name: Install .NET |
| 61 | + uses: actions/setup-dotnet@v4 |
| 62 | + with: |
| 63 | + dotnet-version: ${{inputs.dotnet-version}} |
| 64 | + |
| 65 | + - name: Install Node.js |
| 66 | + uses: actions/setup-node@v4 |
| 67 | + with: |
| 68 | + node-version: ${{inputs.node-version}} |
| 69 | + |
| 70 | + - name: Install Python |
| 71 | + uses: actions/setup-python@v5 |
| 72 | + with: |
| 73 | + python-version: ${{inputs.python-version}} |
| 74 | + |
| 75 | + - name: Install Python deps |
| 76 | + run: |- |
| 77 | + pip3 install virtualenv==20.0.23 |
| 78 | + pip3 install pipenv |
| 79 | +
|
| 80 | + - name: Install Go |
| 81 | + uses: actions/setup-go@v5 |
| 82 | + with: |
| 83 | + go-version: ${{inputs.go-version}} |
| 84 | + |
| 85 | + - name: Install aws-iam-authenticator |
| 86 | + run: >- |
| 87 | + curl -o aws-iam-authenticator |
| 88 | + https://amazon-eks.s3-us-west-2.amazonaws.com/1.13.7/2019-06-11/bin/linux/amd64/aws-iam-authenticator |
| 89 | + chmod +x ./aws-iam-authenticator |
| 90 | + sudo mv aws-iam-authenticator /usr/local/bin |
| 91 | +
|
| 92 | + - name: Install Kubectl |
| 93 | + run: >- |
| 94 | + curl -LO |
| 95 | + https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl |
| 96 | + chmod +x ./kubectl |
| 97 | + sudo mv kubectl /usr/local/bin |
| 98 | +
|
| 99 | + - name: Install and configure Helm |
| 100 | + run: >- |
| 101 | + curl -o- -L |
| 102 | + https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash |
| 103 | + helm init -c |
| 104 | + helm repo add bitnami https://charts.bitnami.com/bitnami |
| 105 | +
|
| 106 | + - name: Authenticate with Google Cloud |
| 107 | + uses: google-github-actions/auth@v2 |
| 108 | + with: |
| 109 | + service_account: ${{ inputs.google-service-account-email }} |
| 110 | + workload_identity_provider: projects/${{ inputs.google-project-number }}/locations/global/workloadIdentityPools/${{ inputs.google-workload-identity-pool }}/providers/${{ inputs.google-workload-identity-provider }} |
| 111 | + |
| 112 | + - name: Install gcloud auth |
| 113 | + uses: google-github-actions/setup-gcloud@v2 |
| 114 | + with: |
| 115 | + install_components: gke-gcloud-auth-plugin |
| 116 | + |
| 117 | + - name: Authenticate with Google Cloud Registry |
| 118 | + run: gcloud --quiet auth configure-docker |
| 119 | + |
| 120 | + - name: Configure AWS Credentials |
| 121 | + uses: aws-actions/configure-aws-credentials@v4 |
| 122 | + with: |
| 123 | + aws-access-key-id: ${{ inputs.aws-access-key-id }} |
| 124 | + aws-region: ${{ inputs.aws-region }} |
| 125 | + aws-secret-access-key: ${{ inputs.aws-secret-access-key }} |
| 126 | + role-duration-seconds: ${{ inputs.role-duration-seconds }} |
| 127 | + role-session-name: ${{ inputs.role-session-name }} |
| 128 | + role-to-assume: ${{ inputs.role-to-assume }} |
| 129 | + |
| 130 | + - name: Install Pulumi |
| 131 | + uses: pulumi/actions@v5 |
| 132 | + with: |
| 133 | + pulumi-version: ${{ inputs.pulumi-version }} |
| 134 | + |
| 135 | + - run: echo "Currently Pulumi $(pulumi version) is installed" |
| 136 | + |
| 137 | + - name: Install testing dependencies |
| 138 | + run: make ensure |
| 139 | + |
| 140 | + - name: Install gotestfmt |
| 141 | + uses: GoTestTools/gotestfmt-action@v2 |
| 142 | + with: |
| 143 | + version: ${{ inputs.gotestfmt-version }} |
| 144 | + token: ${{ inputs.github-token }} |
0 commit comments