-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare to remove actions hooks (#1038)
This will allow us to remove all of our `preTest` hooks in provider ci-mgmt configs - which we'd like to get rid of to avoid arbitary code injection into workflows which make them fragile and hard to refactor. See also #1037 Related to #936 ## Add standalone option for running provider integration tests Set `integrationTestProvider: true` to run `go test [...] -tags=${{ matrix.language }}` in the `provider` directory. Example of existing preTest usage: https://github.com/pulumi/pulumi-gcp/blob/92b64b51bfb05fc0d2d7b9c1cbcafe7de8a6f7f3/.ci-mgmt.yaml#L43 ### Always prepare upstream before testing This step is safe to run, as we already do before the Go build steps elsewhere. The upstream target is always there but might be a no-op. ## Add SSH setup option Set `sshPrivateKey: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }}` to set up SSH for testing. Example of docker use of preTest: https://github.com/pulumi/pulumi-docker/blob/fc1d68f823c34cef72e34e060b093230e21fc636/.ci-mgmt.yaml#L35 # Migration 1. Merge this PR with intent-focused config options 2. Open PRs to the ~28 providers to replace the `preTest` hook with alternative settings - Set `integrationTestProvider: true` on all providers which run integration tests via the provider module - Use `setup-script` for arbitrary bash commands before tests - Set `sshPrivateKey: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }}` for docker 4. Remove the `actions` config completely Existing usage of `actions` hooks (there is no use of `preBuild` - only `preTest`): https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22actions%3A%22&type=code
- Loading branch information
1 parent
1fc1007
commit fba1faf
Showing
18 changed files
with
101 additions
and
32 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
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 |
---|---|---|
|
@@ -190,6 +190,16 @@ jobs: | |
- name: Login to Google Cloud Registry | ||
run: gcloud --quiet auth configure-docker | ||
#{{- end }}# | ||
#{{- if .Config.sshPrivateKey }}# | ||
- name: Setup SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: #{{ .Config.sshPrivateKey }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Prepare upstream code | ||
run: make upstream | ||
#{{- end }}# | ||
#{{- if index .Config "setup-script" }}# | ||
- name: Run setup script | ||
run: #{{ index .Config "setup-script" }}# | ||
|
@@ -204,9 +214,13 @@ jobs: | |
#{{- if .Config.actions.preTest }}# | ||
#{{ .Config.actions.preTest | toYaml | indent 4 }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Run provider tests | ||
working-directory: provider | ||
run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
#{{- end }}# | ||
- name: Run tests | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ | ||
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
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 |
---|---|---|
|
@@ -103,6 +103,16 @@ jobs: | |
- name: Login to Google Cloud Registry | ||
run: gcloud --quiet auth configure-docker | ||
#{{- end }}# | ||
#{{- if .Config.sshPrivateKey }}# | ||
- name: Setup SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: #{{ .Config.sshPrivateKey }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Prepare upstream code | ||
run: make upstream | ||
#{{- end }}# | ||
#{{- if index .Config "setup-script" }}# | ||
- name: Run setup script | ||
run: #{{ index .Config "setup-script" }}# | ||
|
@@ -117,6 +127,12 @@ jobs: | |
#{{- if .Config.actions.preTest }}# | ||
#{{ .Config.actions.preTest | toYaml | indent 4 }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Run provider tests | ||
if: matrix.testTarget == 'local' | ||
working-directory: provider | ||
run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
#{{- end }}# | ||
- name: Run tests | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ | ||
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
|
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 |
---|---|---|
|
@@ -131,6 +131,16 @@ jobs: | |
- name: Login to Google Cloud Registry | ||
run: gcloud --quiet auth configure-docker | ||
#{{- end }}# | ||
#{{- if .Config.sshPrivateKey }}# | ||
- name: Setup SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: #{{ .Config.sshPrivateKey }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Prepare upstream code | ||
run: make upstream | ||
#{{- end }}# | ||
#{{- if index .Config "setup-script" }}# | ||
- name: Run setup script | ||
run: #{{ index .Config "setup-script" }}# | ||
|
@@ -145,9 +155,13 @@ jobs: | |
#{{- if .Config.actions.preTest }}# | ||
#{{ .Config.actions.preTest | toYaml | indent 4 }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Run provider tests | ||
working-directory: provider | ||
run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
#{{- end }}# | ||
- name: Run tests | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ | ||
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
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 |
---|---|---|
|
@@ -130,6 +130,16 @@ jobs: | |
- name: Login to Google Cloud Registry | ||
run: gcloud --quiet auth configure-docker | ||
#{{- end }}# | ||
#{{- if .Config.sshPrivateKey }}# | ||
- name: Setup SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: #{{ .Config.sshPrivateKey }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Prepare upstream code | ||
run: make upstream | ||
#{{- end }}# | ||
#{{- if index .Config "setup-script" }}# | ||
- name: Run setup script | ||
run: #{{ index .Config "setup-script" }}# | ||
|
@@ -144,9 +154,13 @@ jobs: | |
#{{- if .Config.actions.preTest }}# | ||
#{{ .Config.actions.preTest | toYaml | indent 4 }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Run provider tests | ||
working-directory: provider | ||
run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
#{{- end }}# | ||
- name: Run tests | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ | ||
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
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 |
---|---|---|
|
@@ -173,6 +173,16 @@ jobs: | |
- name: Login to Google Cloud Registry | ||
run: gcloud --quiet auth configure-docker | ||
#{{- end }}# | ||
#{{- if .Config.sshPrivateKey }}# | ||
- name: Setup SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: #{{ .Config.sshPrivateKey }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Prepare upstream code | ||
run: make upstream | ||
#{{- end }}# | ||
#{{- if index .Config "setup-script" }}# | ||
- name: Run setup script | ||
run: #{{ index .Config "setup-script" }}# | ||
|
@@ -187,10 +197,15 @@ jobs: | |
#{{- if .Config.actions.preTest }}# | ||
#{{ .Config.actions.preTest | toYaml | indent 4 }}# | ||
#{{- end }}# | ||
#{{- if .Config.integrationTestProvider }}# | ||
- name: Run provider tests | ||
if: matrix.testTarget == 'local' | ||
working-directory: provider | ||
run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
#{{- end }}# | ||
- name: Run tests | ||
if: matrix.testTarget == 'local' | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ | ||
matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
- name: Run pulumi/examples tests | ||
if: matrix.testTarget == 'pulumiExamples' | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ | ||
|
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
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
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
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
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
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
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
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
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
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
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
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