-
Notifications
You must be signed in to change notification settings - Fork 67
192 lines (165 loc) · 6.17 KB
/
test-templates.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Test templates
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 8 * * *'
repository_dispatch:
types:
- trigger-cron
- run-templates-command
workflow_dispatch: {}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULUMI_TEST_OWNER: "moolumi"
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
AWS_REGION: "us-west-2"
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
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
SKIPPED_TESTS: "alicloud,digitalocean,kubernetes,openstack,equinix-metal,civo,aiven,auth0,github,oci,java-jbang,java-gradle,azuredevops,vm-azure"
PULUMI_API: https://api.pulumi-staging.io
PULUMI_VERSION: ${{ github.event.client_payload.ref }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
AZURE_LOCATION: westus
TESTPARALLELISM: 10
PULUMI_TEMPLATE_LOCATION: ${{ github.workspace}}
jobs:
test:
name: Test templates
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
- macOS-latest
- windows-16core-2022
go-version:
- 1.21.x
node-version:
- 18.x
python-version:
- 3.8
dotnet-version:
- 8.0.x
java-version:
- 11
java-distribution:
- temurin
runs-on: ${{ matrix.platform }}
permissions:
contents: read
id-token: write
steps:
- if: contains(matrix.platform, 'ubuntu')
name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with:
tool-cache: false
swap-storage: false
- name: Install ${{ matrix.java-version }} (${{ matrix.java-distribution }})
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.java-distribution }}
java-version: ${{ matrix.java-version }}
- if: contains(matrix.platform, 'macOS')
name: Install Scala
run: |
brew install sbt
- name: Install .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- if: contains(matrix.platform, 'ubuntu') || contains(matrix.platform, 'windows')
name: Run 'dotnet clean' on Windows and Ubuntu
run: |
dotnet nuget locals all --clear
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install Pulumi
uses: pulumi/actions@v5
with:
pulumi-version: ${{ env.PULUMI_VERSION != '' && format('v{0}', env.PULUMI_VERSION) || 'dev' }}
- run: echo "$(pulumi version)"
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python deps
run: |
pip3 install pyenv-win
pip3 install pipenv
- name: Check out the code
uses: actions/checkout@v4
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
role-duration-seconds: 14400 # 4 hours
role-session-name: templates@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: Set up gcloud auth
uses: google-github-actions/setup-gcloud@v2
with:
install_components: gke-gcloud-auth-plugin
- name: Install gotestfmt
uses: jaxxstorm/[email protected]
with:
repo: gotesttools/gotestfmt
- name: Install dependencies
run: make ensure
- if: contains(matrix.platform, 'windows')
name: Run Windows tests
shell: bash
run: |
set -euo pipefail
cd tests && go test -v -json -count=1 -cover -timeout 6h -parallel ${{ env.TESTPARALLELISM }} . 2>&1 | gotestfmt
env:
PULUMI_PYTHON_CMD: python
TESTPARALLELISM: 3
SKIPPED_TESTS: "alicloud,digitalocean,kubernetes,openstack,equinix-metal,civo,aiven,auth0,github,oci,java-jbang,java-gradle,azuredevops,container,vm-azure,fsharp,gcp-visualbasic,azure-classic-visualbasic"
- if: contains(matrix.platform, 'ubuntu')
name: Run Linux tests
run: |
set -euo pipefail
cd tests && go test -v -json -count=1 -cover -timeout 6h -parallel ${{ env.TESTPARALLELISM }} . 2>&1 | gotestfmt
- if: contains(matrix.platform, 'macOS')
name: Run macOS tests
run: |
set -euo pipefail
cd tests && go test -v -json -count=1 -cover -timeout 6h -parallel ${{ env.TESTPARALLELISM }} . 2>&1 | gotestfmt
env:
TESTPARALLELISM: 6
- if: 'failure()'
name: Notify Slack
uses: 8398a7/action-slack@v3
with:
author_name: Failure in ${{ matrix.platform }} template Tests
fields: repo,commit,author,action
status: ${{ job.status }}