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