Skip to content

Commit b012e52

Browse files
Update GitHub Actions workflows. (#147)
* [internal] Update GitHub Actions workflow files * Update .gitignore --------- Co-authored-by: Daniel Bradley <[email protected]>
1 parent 50d7563 commit b012e52

9 files changed

+245
-116
lines changed

.github/workflows/build_provider.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
uses: ./.github/actions/setup-tools
3838
with:
3939
tools: pulumictl, go
40+
- name: Prepare local workspace before restoring previously built
41+
run: make prepare_local_workspace
4042
- name: Download schema-embed.json
4143
uses: actions/download-artifact@v4
4244
with:
@@ -45,9 +47,11 @@ jobs:
4547
# Avoid creating directories for each artifact
4648
merge-multiple: true
4749
path: provider/cmd/pulumi-resource-xyz/schema-embed.json
48-
- name: Prepare for build
49-
# This installs plugins and prepares upstream
50-
run: make upstream
50+
- name: Restore makefile progress
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: prerequisites.make
54+
path: .make
5155
- name: Build & package provider
5256
run: make provider_dist-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
5357
- name: Upload artifacts

.github/workflows/build_sdk.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,17 @@ jobs:
5353
uses: ./.github/actions/setup-tools
5454
with:
5555
tools: pulumictl, pulumicli, ${{ matrix.language }}
56+
- name: Prepare local workspace
57+
run: make prepare_local_workspace
5658
- name: Download bin
5759
uses: ./.github/actions/download-bin
58-
- name: Install plugins
59-
run: make install_plugins
6060
- name: Update path
6161
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
62+
- name: Restore makefile progress
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: prerequisites.make
66+
path: .make
6267
- name: Build SDK
6368
run: make build_${{ matrix.language }}
6469
- name: Check worktree clean
@@ -74,3 +79,9 @@ jobs:
7479
uses: ./.github/actions/upload-sdk
7580
with:
7681
language: ${{ matrix.language }}
82+
- name: Save makefile progress
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: build_${{ matrix.language }}.make
86+
path: .make
87+
include-hidden-files: true

.github/workflows/main.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,19 @@ jobs:
144144
uses: ./.github/actions/setup-tools
145145
with:
146146
tools: pulumictl, pulumicli, ${{ matrix.language }}
147+
- name: Prepare local workspace
148+
run: make prepare_local_workspace
147149
- name: Download bin
148150
uses: ./.github/actions/download-bin
149-
- name: Add NuGet source
150-
if: matrix.language == 'dotnet'
151-
run: dotnet nuget add source ${{ github.workspace }}/nuget
152151
- name: Download SDK
153152
uses: ./.github/actions/download-sdk
154153
with:
155154
language: ${{ matrix.language }}
155+
- name: Restore makefile progress
156+
uses: actions/download-artifact@v4
157+
with:
158+
name: build_${{ matrix.language }}.make
159+
path: .make
156160
- name: Update path
157161
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
158162
- name: Install Python deps

.github/workflows/prerelease.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,19 @@ jobs:
8686
uses: ./.github/actions/setup-tools
8787
with:
8888
tools: pulumictl, pulumicli, dotnet, go, nodejs, python
89+
- name: Prepare local workspace
90+
run: make prepare_local_workspace
8991
- name: Download bin
9092
uses: ./.github/actions/download-bin
91-
- name: Add NuGet source
92-
if: matrix.language == 'dotnet'
93-
run: dotnet nuget add source ${{ github.workspace }}/nuget
9493
- name: Download SDK
9594
uses: ./.github/actions/download-sdk
9695
with:
9796
language: ${{ matrix.language }}
97+
- name: Restore makefile progress
98+
uses: actions/download-artifact@v4
99+
with:
100+
name: build_${{ matrix.language }}.make
101+
path: .make
98102
- name: Update path
99103
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
100104
- name: Install Python deps

.github/workflows/prerequisites.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,16 @@ jobs:
5656
path: |
5757
.pulumi/examples-cache
5858
key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }}
59-
- name: Prepare upstream code
60-
run: make upstream
6159
- name: Setup tools
6260
uses: ./.github/actions/setup-tools
6361
with:
6462
tools: go, pulumictl, pulumicli, schema-tools
65-
- name: Build schema generator binary
66-
run: make tfgen_build_only
67-
- name: Install plugins
68-
run: make install_plugins
63+
- name: Prepare local workspace before restoring previously built files
64+
run: make prepare_local_workspace
6965
- name: Generate schema
70-
run: make tfgen_no_deps
66+
run: make schema
7167
- name: Build provider binary
72-
run: make provider_no_deps
68+
run: make provider
7369
- name: Unit-test provider code
7470
run: make test_provider
7571
- if: inputs.is_pr
@@ -81,6 +77,12 @@ jobs:
8177
schema-tools compare -r github://api.github.com/pulumi -p xyz -o "${{ inputs.default_branch }}" -n --local-path=provider/cmd/pulumi-resource-xyz/schema.json;
8278
echo "$EOF";
8379
} >> "$GITHUB_ENV"
80+
- name: Save makefile progress
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: prerequisites.make
84+
path: .make
85+
include-hidden-files: true
8486
- if: inputs.is_pr && inputs.is_automated == false
8587
name: Comment on PR with Details of Schema Check
8688
uses: thollander/actions-comment-pull-request@v2

.github/workflows/release.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,19 @@ jobs:
9292
uses: ./.github/actions/setup-tools
9393
with:
9494
tools: pulumictl, pulumicli, ${{ matrix.language }}
95+
- name: Prepare local workspace
96+
run: make prepare_local_workspace
9597
- name: Download bin
9698
uses: ./.github/actions/download-bin
97-
- name: Add NuGet source
98-
if: matrix.language == 'dotnet'
99-
run: dotnet nuget add source ${{ github.workspace }}/nuget
10099
- name: Download SDK
101100
uses: ./.github/actions/download-sdk
102101
with:
103102
language: ${{ matrix.language }}
103+
- name: Restore makefile progress
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: build_${{ matrix.language }}.make
107+
path: .make
104108
- name: Update path
105109
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
106110
- name: Install Python deps

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,19 @@ jobs:
141141
uses: ./.github/actions/setup-tools
142142
with:
143143
tools: pulumictl, pulumicli, ${{ matrix.language }}
144+
- name: Prepare local workspace
145+
run: make prepare_local_workspace
144146
- name: Download bin
145147
uses: ./.github/actions/download-bin
146-
- name: Add NuGet source
147-
if: matrix.language == 'dotnet'
148-
run: dotnet nuget add source ${{ github.workspace }}/nuget
149148
- name: Download SDK
150149
uses: ./.github/actions/download-sdk
151150
with:
152151
language: ${{ matrix.language }}
152+
- name: Restore makefile progress
153+
uses: actions/download-artifact@v4
154+
with:
155+
name: build_${{ matrix.language }}.make
156+
path: .make
153157
- name: Update path
154158
run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
155159
- name: Install Python deps

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Pulumi.*.yaml
1212

1313
.idea/
1414
*.iml
15+
*.sln
16+
.vscode/settings.json
1517

1618
yarn.lock
1719
**/pulumiManifest.go
@@ -31,4 +33,7 @@ sdk/java/gradlew.bat
3133
sdk/python/venv
3234

3335
go.work
34-
go.work.sum
36+
go.work.sum
37+
38+
# Ignore local build tracking directory
39+
.make

0 commit comments

Comments
 (0)