Skip to content

Commit 3a4ebdb

Browse files
authored
Update GitHub Actions workflows. (#638)
This PR was automatically generated by the update-workflows-ecosystem-providers workflow in the pulumi/ci-mgmt repo, from commit 87d055d9cb5d343b24a577da140f4eb258c2d6f6.
1 parent 749f03f commit 3a4ebdb

11 files changed

+153
-217
lines changed

.github/actions/setup-tools/action.yml

+8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ inputs:
1414
dotnet
1515
java
1616
default: all
17+
cache-go:
18+
description: |
19+
Whether to enable the GitHub cache for Go. Appropriate for disabling in
20+
smaller jobs that typically completely before the "real" job has an
21+
opportunity to populate the cache.
22+
default: "true"
1723

1824
runs:
1925
using: "composite"
@@ -27,6 +33,8 @@ runs:
2733
provider/*.sum
2834
upstream/*.sum
2935
sdk/*.sum
36+
# TODO(https://github.com/actions/setup-go/issues/316): Restore but don't save the cache.
37+
cache: ${{ inputs.cache-go }}
3038

3139
- name: Install pulumictl
3240
if: inputs.tools == 'all' || contains(inputs.tools, 'pulumictl')

.github/workflows/license.yml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
uses: ./.github/actions/setup-tools
4343
with:
4444
tools: go
45+
cache-go: false
4546
- run: make upstream
4647
- uses: pulumi/license-check-action@main
4748
with:

.github/workflows/master.yml

+5-51
Original file line numberDiff line numberDiff line change
@@ -131,61 +131,15 @@ jobs:
131131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132132

133133
test:
134-
name: test
134+
uses: ./.github/workflows/test.yml
135135
needs:
136136
- prerequisites
137137
- build_provider
138138
- build_sdk
139-
permissions:
140-
contents: read
141-
id-token: write
142-
runs-on: ubuntu-latest
143-
env:
144-
PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }}
145-
steps:
146-
- name: Checkout Repo
147-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
148-
with:
149-
persist-credentials: false
150-
- name: Setup tools
151-
uses: ./.github/actions/setup-tools
152-
with:
153-
tools: pulumictl, pulumicli, ${{ matrix.language }}
154-
- name: Prepare local workspace
155-
run: make prepare_local_workspace
156-
- name: Download bin
157-
uses: ./.github/actions/download-bin
158-
- name: Download SDK
159-
uses: ./.github/actions/download-sdk
160-
with:
161-
language: ${{ matrix.language }}
162-
- name: Restore makefile progress
163-
run: make --touch provider schema build_${{ matrix.language }}
164-
- name: Update path
165-
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
166-
- name: Install Python deps
167-
if: matrix.language == 'python'
168-
run: |-
169-
pip3 install virtualenv==20.0.23
170-
pip3 install pipenv
171-
- name: Install dependencies
172-
run: make install_${{ matrix.language}}_sdk
173-
- name: Install gotestfmt
174-
uses: GoTestTools/gotestfmt-action@v2
175-
with:
176-
token: ${{ secrets.GITHUB_TOKEN }}
177-
version: v2.5.0
178-
- name: Run tests
179-
run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4
180-
strategy:
181-
fail-fast: false
182-
matrix:
183-
language:
184-
- nodejs
185-
- python
186-
- dotnet
187-
- go
188-
- java
139+
secrets: inherit
140+
with:
141+
version: ${{ needs.prerequisites.outputs.version }}
142+
189143
name: master
190144
on:
191145
workflow_dispatch: {}

.github/workflows/prerelease.yml

+4-51
Original file line numberDiff line numberDiff line change
@@ -72,61 +72,14 @@ jobs:
7272
isPrerelease: true
7373

7474
test:
75-
name: test
75+
uses: ./.github/workflows/test.yml
7676
needs:
7777
- prerequisites
7878
- build_provider
7979
- build_sdk
80-
permissions:
81-
contents: read
82-
id-token: write
83-
runs-on: ubuntu-latest
84-
env:
85-
PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }}
86-
steps:
87-
- name: Checkout Repo
88-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
89-
with:
90-
persist-credentials: false
91-
- name: Setup tools
92-
uses: ./.github/actions/setup-tools
93-
with:
94-
tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java
95-
- name: Prepare local workspace
96-
run: make prepare_local_workspace
97-
- name: Download bin
98-
uses: ./.github/actions/download-bin
99-
- name: Download SDK
100-
uses: ./.github/actions/download-sdk
101-
with:
102-
language: ${{ matrix.language }}
103-
- name: Restore makefile progress
104-
run: make --touch provider schema build_${{ matrix.language }}
105-
- name: Update path
106-
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
107-
- name: Install Python deps
108-
if: matrix.language == 'python'
109-
run: |-
110-
pip3 install virtualenv==20.0.23
111-
pip3 install pipenv
112-
- name: Install dependencies
113-
run: make install_${{ matrix.language}}_sdk
114-
- name: Install gotestfmt
115-
uses: GoTestTools/gotestfmt-action@v2
116-
with:
117-
token: ${{ secrets.GITHUB_TOKEN }}
118-
version: v2.5.0
119-
- name: Run tests
120-
run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 .
121-
strategy:
122-
fail-fast: false
123-
matrix:
124-
language:
125-
- nodejs
126-
- python
127-
- dotnet
128-
- go
129-
- java
80+
secrets: inherit
81+
with:
82+
version: ${{ needs.prerequisites.outputs.version }}
13083

13184
name: prerelease
13285
on:

.github/workflows/prerequisites.yml

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ jobs:
7575
run: make provider
7676
- name: Unit-test provider code
7777
run: make test_provider
78+
- name: Upload coverage reports to Codecov
79+
uses: codecov/codecov-action@c2fcb216de2b0348de0100baa3ea2cad9f100a01 # v5.1.0
80+
env:
81+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
7882
- if: inputs.is_pr
7983
name: Check Schema is Valid
8084
run: |

.github/workflows/publish.yml

+10
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ jobs:
117117
name: publish_sdk
118118
needs: publish
119119
runs-on: ubuntu-latest
120+
outputs:
121+
python_version: ${{ steps.python_version.outputs.version }}
120122
steps:
121123
- name: Checkout Repo
122124
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -157,6 +159,13 @@ jobs:
157159
go.*
158160
go/**
159161
!*.tar.gz
162+
- name: Extract python version
163+
id: python_version
164+
working-directory: sdk/python
165+
run: |
166+
pip install toml-cli==0.7.0
167+
version=$(toml get --toml-path pyproject.toml project.version)
168+
echo "version=${version}" >> "$GITHUB_OUTPUT"
160169
create_docs_build:
161170
name: create_docs_build
162171
needs: publish_sdk
@@ -208,3 +217,4 @@ jobs:
208217
# Prelease is run often but we only have 5 concurrent macos runners, so we only test after the stable release.
209218
enableMacosRunner: ${{ inputs.isPrerelease == false }}
210219
skipGoSdk: ${{ inputs.skipGoSdk }}
220+
pythonVersion: ${{ needs.publish_sdk.outputs.python_version }}

.github/workflows/release.yml

+4-51
Original file line numberDiff line numberDiff line change
@@ -78,58 +78,11 @@ jobs:
7878
isPrerelease: false
7979

8080
test:
81-
name: test
81+
uses: ./.github/workflows/test.yml
8282
needs:
8383
- prerequisites
8484
- build_provider
8585
- build_sdk
86-
permissions:
87-
contents: read
88-
id-token: write
89-
runs-on: ubuntu-latest
90-
env:
91-
PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }}
92-
steps:
93-
- name: Checkout Repo
94-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
95-
with:
96-
persist-credentials: false
97-
- name: Setup tools
98-
uses: ./.github/actions/setup-tools
99-
with:
100-
tools: pulumictl, pulumicli, ${{ matrix.language }}
101-
- name: Prepare local workspace
102-
run: make prepare_local_workspace
103-
- name: Download bin
104-
uses: ./.github/actions/download-bin
105-
- name: Download SDK
106-
uses: ./.github/actions/download-sdk
107-
with:
108-
language: ${{ matrix.language }}
109-
- name: Restore makefile progress
110-
run: make --touch provider schema build_${{ matrix.language }}
111-
- name: Update path
112-
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
113-
- name: Install Python deps
114-
if: matrix.language == 'python'
115-
run: |-
116-
pip3 install virtualenv==20.0.23
117-
pip3 install pipenv
118-
- name: Install dependencies
119-
run: make install_${{ matrix.language}}_sdk
120-
- name: Install gotestfmt
121-
uses: GoTestTools/gotestfmt-action@v2
122-
with:
123-
token: ${{ secrets.GITHUB_TOKEN }}
124-
version: v2.5.0
125-
- name: Run tests
126-
run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 .
127-
strategy:
128-
fail-fast: false
129-
matrix:
130-
language:
131-
- nodejs
132-
- python
133-
- dotnet
134-
- go
135-
- java
86+
secrets: inherit
87+
with:
88+
version: ${{ needs.prerequisites.outputs.version }}

.github/workflows/run-acceptance-tests.yml

+6-63
Original file line numberDiff line numberDiff line change
@@ -118,75 +118,18 @@ jobs:
118118
sha: ${{ github.event.pull_request.head.sha || github.sha }}
119119

120120
test:
121+
# Don't run tests on PRs from forks.
121122
if: github.event_name == 'repository_dispatch' ||
122123
github.event.pull_request.head.repo.full_name == github.repository
123-
name: test
124+
uses: ./.github/workflows/test.yml
124125
needs:
125126
- prerequisites
126127
- build_provider
127128
- build_sdk
128-
permissions:
129-
contents: read
130-
id-token: write
131-
runs-on: ubuntu-latest
132-
env:
133-
PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }}
134-
steps:
135-
- name: Checkout Repo
136-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
137-
with:
138-
ref: ${{ env.PR_COMMIT_SHA }}
139-
persist-credentials: false
140-
- name: Checkout p/examples
141-
if: matrix.testTarget == 'pulumiExamples'
142-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
143-
with:
144-
repository: pulumi/examples
145-
path: p-examples
146-
- name: Setup tools
147-
uses: ./.github/actions/setup-tools
148-
with:
149-
tools: pulumictl, pulumicli, ${{ matrix.language }}
150-
- name: Prepare local workspace
151-
run: make prepare_local_workspace
152-
- name: Download bin
153-
uses: ./.github/actions/download-bin
154-
- name: Download SDK
155-
uses: ./.github/actions/download-sdk
156-
with:
157-
language: ${{ matrix.language }}
158-
- name: Restore makefile progress
159-
run: make --touch provider schema build_${{ matrix.language }}
160-
- name: Update path
161-
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
162-
- name: Install Python deps
163-
if: matrix.language == 'python'
164-
run: |-
165-
pip3 install virtualenv==20.0.23
166-
pip3 install pipenv
167-
- name: Install dependencies
168-
run: make install_${{ matrix.language}}_sdk
169-
- name: Install gotestfmt
170-
uses: GoTestTools/gotestfmt-action@v2
171-
with:
172-
token: ${{ secrets.GITHUB_TOKEN }}
173-
version: v2.5.0
174-
- name: Run tests
175-
if: matrix.testTarget == 'local'
176-
run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 .
177-
- name: Run pulumi/examples tests
178-
if: matrix.testTarget == 'pulumiExamples'
179-
run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 .
180-
strategy:
181-
fail-fast: false
182-
matrix:
183-
language:
184-
- nodejs
185-
- python
186-
- dotnet
187-
- go
188-
- java
189-
testTarget: [local]
129+
secrets: inherit
130+
with:
131+
version: ${{ needs.prerequisites.outputs.version }}
132+
190133
license_check:
191134
name: License Check
192135
uses: ./.github/workflows/license.yml

0 commit comments

Comments
 (0)