Skip to content

Commit a026903

Browse files
authored
[internal] Update GitHub Actions workflow files (#155)
1 parent 7dc62d9 commit a026903

14 files changed

+264
-167
lines changed

.github/workflows/artifact-cleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
age: 1 month
99
skip-tags: true
1010
name: cleanup
11-
"on":
11+
on:
1212
schedule:
1313
- cron: 0 1 * * *

.github/workflows/command-dispatch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
reaction-token: ${{ secrets.GITHUB_TOKEN }}
2727
repository: pulumi/pulumi-postgresql
2828
token: ${{ secrets.PULUMI_BOT_TOKEN }}
29-
strategy: {}
30-
"on":
29+
name: command-dispatch
30+
on:
3131
issue_comment:
3232
types:
3333
- created
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
env:
2+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3+
jobs:
4+
warn_codegen:
5+
name: warn_codegen
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout Repo
9+
uses: actions/checkout@v2
10+
- id: schema_changed
11+
name: Check for diff in schema
12+
uses: dorny/paths-filter@v2
13+
with:
14+
filters: "changed: 'provider/cmd/**/schema.json'"
15+
- id: sdk_changed
16+
if: steps.schema_changed.outputs.changed == 'false'
17+
name: Check for diff in sdk/*
18+
uses: dorny/paths-filter@v2
19+
with:
20+
filters: "changed: 'sdk/*'"
21+
- if: steps.sdk_changed.outputs.changed == 'true'
22+
name: Send codegen warning as comment on PR
23+
uses: thollander/actions-comment-pull-request@v1
24+
with:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
message: >
27+
Hello and thank you for your pull request! :heart: :sparkles:
28+
29+
It looks like you're directly modifying files in the language SDKs, many of which are autogenerated.
30+
31+
Be sure any files you're editing do not begin with a code generation warning.
32+
33+
For generated files, you will need to make changes in `resources.go` instead, and [generate the code](https://github.com/pulumi/${{ github.event.repository.name }}/blob/master/CONTRIBUTING.md#committing-generated-code).
34+
name: warn-codegen
35+
on:
36+
pull_request_target:
37+
branches:
38+
- main
39+
- master
40+
types:
41+
- opened

.github/workflows/main.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ jobs:
5555
name: ${{ env.PROVIDER }}-provider.tar.gz
5656
path: ${{ github.workspace }}/bin
5757
- name: Untar provider binaries
58-
run: |-
59-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin
58+
run: >-
59+
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
60+
github.workspace}}/bin
61+
6062
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
6163
- name: Install plugins
6264
run: make install_plugins
@@ -67,8 +69,7 @@ jobs:
6769
- name: Check worktree clean
6870
run: ./ci-scripts/ci/check-worktree-is-clean
6971
- name: Compress SDK folder
70-
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }}
71-
.
72+
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
7273
- name: Upload artifacts
7374
uses: actions/upload-artifact@v2
7475
with:
@@ -142,9 +143,11 @@ jobs:
142143
- name: Summarize Provider Coverage Results
143144
run: cat ${{ env.COVERAGE_OUTPUT_DIR }}/shortSummary.txt
144145
- name: Upload coverage data to S3
145-
run: |-
146+
run: >-
146147
summaryName="${PROVIDER}_summary_`date +"%Y-%m-%d_%H-%M-%S"`.json"
148+
147149
s3FullURI="s3://${{ secrets.S3_COVERAGE_BUCKET_NAME }}/summaries/${summaryName}"
150+
148151
aws s3 cp ${{ env.COVERAGE_OUTPUT_DIR }}/summary.json ${s3FullURI} --acl bucket-owner-full-control
149152
strategy:
150153
fail-fast: true
@@ -258,9 +261,11 @@ jobs:
258261
run: make provider
259262
- if: github.event_name == 'pull_request'
260263
name: Check Schema is Valid
261-
run: |-
264+
run: >-
262265
echo 'SCHEMA_CHANGES<<EOF' >> $GITHUB_ENV
266+
263267
schema-tools compare ${{ env.PROVIDER }} master --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> $GITHUB_ENV
268+
264269
echo 'EOF' >> $GITHUB_ENV
265270
- if: github.event_name == 'pull_request'
266271
name: Comment on PR with Details of Schema Check
@@ -272,9 +277,9 @@ jobs:
272277
273278
${{ env.SCHEMA_CHANGES }}
274279
- name: Tar provider binaries
275-
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace
276-
}}/bin/ pulumi-resource-${{ env.PROVIDER }} pulumi-tfgen-${{ env.PROVIDER
277-
}}
280+
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
281+
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
282+
pulumi-tfgen-${{ env.PROVIDER }}
278283
- name: Upload artifacts
279284
uses: actions/upload-artifact@v2
280285
with:
@@ -397,21 +402,24 @@ jobs:
397402
name: python-sdk.tar.gz
398403
path: ${{ github.workspace}}/sdk/
399404
- name: Uncompress python SDK
400-
run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C ${{github.workspace}}/sdk/python
405+
run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C
406+
${{github.workspace}}/sdk/python
401407
- name: Download dotnet SDK
402408
uses: actions/download-artifact@v2
403409
with:
404410
name: dotnet-sdk.tar.gz
405411
path: ${{ github.workspace}}/sdk/
406412
- name: Uncompress dotnet SDK
407-
run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C ${{github.workspace}}/sdk/dotnet
413+
run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C
414+
${{github.workspace}}/sdk/dotnet
408415
- name: Download nodejs SDK
409416
uses: actions/download-artifact@v2
410417
with:
411418
name: nodejs-sdk.tar.gz
412419
path: ${{ github.workspace}}/sdk/
413420
- name: Uncompress nodejs SDK
414-
run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C ${{github.workspace}}/sdk/nodejs
421+
run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C
422+
${{github.workspace}}/sdk/nodejs
415423
- run: python -m pip install pip twine
416424
- env:
417425
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -478,8 +486,10 @@ jobs:
478486
name: ${{ env.PROVIDER }}-provider.tar.gz
479487
path: ${{ github.workspace }}/bin
480488
- name: Untar provider binaries
481-
run: |-
482-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin
489+
run: >-
490+
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
491+
github.workspace}}/bin
492+
483493
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
484494
- run: dotnet nuget add source ${{ github.workspace }}/nuget
485495
- name: Download SDK
@@ -505,8 +515,8 @@ jobs:
505515
with:
506516
repo: haveyoudebuggedit/gotestfmt
507517
- name: Run tests
508-
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language
509-
}} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
518+
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{
519+
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
510520
- if: failure() && github.event_name == 'push'
511521
name: Notify Slack
512522
uses: 8398a7/action-slack@v3
@@ -531,13 +541,13 @@ jobs:
531541
pythonversion:
532542
- "3.7"
533543
name: main
534-
"on":
544+
on:
535545
push:
536546
branches:
537547
- main
538548
paths-ignore:
539-
- '**.md'
549+
- "**.md"
540550
tags-ignore:
541551
- v*
542552
- sdk/*
543-
- '**'
553+
- "**"

.github/workflows/master.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ jobs:
5555
name: ${{ env.PROVIDER }}-provider.tar.gz
5656
path: ${{ github.workspace }}/bin
5757
- name: Untar provider binaries
58-
run: |-
59-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin
58+
run: >-
59+
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
60+
github.workspace}}/bin
61+
6062
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
6163
- name: Install plugins
6264
run: make install_plugins
@@ -67,8 +69,7 @@ jobs:
6769
- name: Check worktree clean
6870
run: ./ci-scripts/ci/check-worktree-is-clean
6971
- name: Compress SDK folder
70-
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }}
71-
.
72+
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
7273
- name: Upload artifacts
7374
uses: actions/upload-artifact@v2
7475
with:
@@ -142,9 +143,11 @@ jobs:
142143
- name: Summarize Provider Coverage Results
143144
run: cat ${{ env.COVERAGE_OUTPUT_DIR }}/shortSummary.txt
144145
- name: Upload coverage data to S3
145-
run: |-
146+
run: >-
146147
summaryName="${PROVIDER}_summary_`date +"%Y-%m-%d_%H-%M-%S"`.json"
148+
147149
s3FullURI="s3://${{ secrets.S3_COVERAGE_BUCKET_NAME }}/summaries/${summaryName}"
150+
148151
aws s3 cp ${{ env.COVERAGE_OUTPUT_DIR }}/summary.json ${s3FullURI} --acl bucket-owner-full-control
149152
strategy:
150153
fail-fast: true
@@ -258,9 +261,11 @@ jobs:
258261
run: make provider
259262
- if: github.event_name == 'pull_request'
260263
name: Check Schema is Valid
261-
run: |-
264+
run: >-
262265
echo 'SCHEMA_CHANGES<<EOF' >> $GITHUB_ENV
266+
263267
schema-tools compare ${{ env.PROVIDER }} master --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> $GITHUB_ENV
268+
264269
echo 'EOF' >> $GITHUB_ENV
265270
- if: github.event_name == 'pull_request'
266271
name: Comment on PR with Details of Schema Check
@@ -272,9 +277,9 @@ jobs:
272277
273278
${{ env.SCHEMA_CHANGES }}
274279
- name: Tar provider binaries
275-
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace
276-
}}/bin/ pulumi-resource-${{ env.PROVIDER }} pulumi-tfgen-${{ env.PROVIDER
277-
}}
280+
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
281+
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
282+
pulumi-tfgen-${{ env.PROVIDER }}
278283
- name: Upload artifacts
279284
uses: actions/upload-artifact@v2
280285
with:
@@ -397,21 +402,24 @@ jobs:
397402
name: python-sdk.tar.gz
398403
path: ${{ github.workspace}}/sdk/
399404
- name: Uncompress python SDK
400-
run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C ${{github.workspace}}/sdk/python
405+
run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C
406+
${{github.workspace}}/sdk/python
401407
- name: Download dotnet SDK
402408
uses: actions/download-artifact@v2
403409
with:
404410
name: dotnet-sdk.tar.gz
405411
path: ${{ github.workspace}}/sdk/
406412
- name: Uncompress dotnet SDK
407-
run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C ${{github.workspace}}/sdk/dotnet
413+
run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C
414+
${{github.workspace}}/sdk/dotnet
408415
- name: Download nodejs SDK
409416
uses: actions/download-artifact@v2
410417
with:
411418
name: nodejs-sdk.tar.gz
412419
path: ${{ github.workspace}}/sdk/
413420
- name: Uncompress nodejs SDK
414-
run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C ${{github.workspace}}/sdk/nodejs
421+
run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C
422+
${{github.workspace}}/sdk/nodejs
415423
- run: python -m pip install pip twine
416424
- env:
417425
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -478,8 +486,10 @@ jobs:
478486
name: ${{ env.PROVIDER }}-provider.tar.gz
479487
path: ${{ github.workspace }}/bin
480488
- name: Untar provider binaries
481-
run: |-
482-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin
489+
run: >-
490+
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
491+
github.workspace}}/bin
492+
483493
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
484494
- run: dotnet nuget add source ${{ github.workspace }}/nuget
485495
- name: Download SDK
@@ -505,8 +515,8 @@ jobs:
505515
with:
506516
repo: haveyoudebuggedit/gotestfmt
507517
- name: Run tests
508-
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language
509-
}} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
518+
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{
519+
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
510520
- if: failure() && github.event_name == 'push'
511521
name: Notify Slack
512522
uses: 8398a7/action-slack@v3
@@ -531,13 +541,13 @@ jobs:
531541
pythonversion:
532542
- "3.7"
533543
name: master
534-
"on":
544+
on:
535545
push:
536546
branches:
537547
- master
538548
paths-ignore:
539-
- '**.md'
549+
- "**.md"
540550
tags-ignore:
541551
- v*
542552
- sdk/*
543-
- '**'
553+
- "**"

0 commit comments

Comments
 (0)