Skip to content

Commit

Permalink
[internal] Update GitHub Actions workflow files (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
pulumi-bot authored Apr 25, 2022
1 parent c1f9f1c commit 2a11c30
Show file tree
Hide file tree
Showing 14 changed files with 260 additions and 165 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/artifact-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
age: 1 month
skip-tags: true
name: cleanup
"on":
on:
schedule:
- cron: 0 1 * * *
4 changes: 2 additions & 2 deletions .github/workflows/command-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
reaction-token: ${{ secrets.GITHUB_TOKEN }}
repository: pulumi/pulumi-f5bigip
token: ${{ secrets.PULUMI_BOT_TOKEN }}
strategy: {}
"on":
name: command-dispatch
on:
issue_comment:
types:
- created
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/community-moderation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
warn_codegen:
name: warn_codegen
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- id: schema_changed
name: Check for diff in schema
uses: dorny/paths-filter@v2
with:
filters: "changed: 'provider/cmd/**/schema.json'"
- id: sdk_changed
if: steps.schema_changed.outputs.changed == 'false'
name: Check for diff in sdk/*
uses: dorny/paths-filter@v2
with:
filters: "changed: 'sdk/*'"
- if: steps.sdk_changed.outputs.changed == 'true'
name: Send codegen warning as comment on PR
uses: thollander/actions-comment-pull-request@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: >
Hello and thank you for your pull request! :heart: :sparkles:
It looks like you're directly modifying files in the language SDKs, many of which are autogenerated.
Be sure any files you're editing do not begin with a code generation warning.
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).
name: warn-codegen
on:
pull_request_target:
branches:
- main
- master
types:
- opened
48 changes: 29 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ jobs:
name: ${{ env.PROVIDER }}-provider.tar.gz
path: ${{ github.workspace }}/bin
- name: Untar provider binaries
run: |-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin
run: >-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace}}/bin
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
- name: Install plugins
run: make install_plugins
Expand All @@ -71,8 +73,7 @@ jobs:
- name: Check worktree clean
run: ./ci-scripts/ci/check-worktree-is-clean
- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }}
.
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -146,9 +147,11 @@ jobs:
- name: Summarize Provider Coverage Results
run: cat ${{ env.COVERAGE_OUTPUT_DIR }}/shortSummary.txt
- name: Upload coverage data to S3
run: |-
run: >-
summaryName="${PROVIDER}_summary_`date +"%Y-%m-%d_%H-%M-%S"`.json"
s3FullURI="s3://${{ secrets.S3_COVERAGE_BUCKET_NAME }}/summaries/${summaryName}"
aws s3 cp ${{ env.COVERAGE_OUTPUT_DIR }}/summary.json ${s3FullURI} --acl bucket-owner-full-control
strategy:
fail-fast: true
Expand Down Expand Up @@ -262,9 +265,11 @@ jobs:
run: make provider
- if: github.event_name == 'pull_request'
name: Check Schema is Valid
run: |-
run: >-
echo 'SCHEMA_CHANGES<<EOF' >> $GITHUB_ENV
schema-tools compare ${{ env.PROVIDER }} master --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- if: github.event_name == 'pull_request'
name: Comment on PR with Details of Schema Check
Expand All @@ -276,9 +281,9 @@ jobs:
${{ env.SCHEMA_CHANGES }}
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace
}}/bin/ pulumi-resource-${{ env.PROVIDER }} pulumi-tfgen-${{ env.PROVIDER
}}
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
pulumi-tfgen-${{ env.PROVIDER }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -401,21 +406,24 @@ jobs:
name: python-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress python SDK
run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C ${{github.workspace}}/sdk/python
run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C
${{github.workspace}}/sdk/python
- name: Download dotnet SDK
uses: actions/download-artifact@v2
with:
name: dotnet-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress dotnet SDK
run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C ${{github.workspace}}/sdk/dotnet
run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C
${{github.workspace}}/sdk/dotnet
- name: Download nodejs SDK
uses: actions/download-artifact@v2
with:
name: nodejs-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress nodejs SDK
run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C ${{github.workspace}}/sdk/nodejs
run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C
${{github.workspace}}/sdk/nodejs
- run: python -m pip install pip twine
- env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down Expand Up @@ -482,8 +490,10 @@ jobs:
name: ${{ env.PROVIDER }}-provider.tar.gz
path: ${{ github.workspace }}/bin
- name: Untar provider binaries
run: |-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin
run: >-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace}}/bin
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
- run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Download SDK
Expand Down Expand Up @@ -516,8 +526,8 @@ jobs:
with:
repo: haveyoudebuggedit/gotestfmt
- 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
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand All @@ -542,13 +552,13 @@ jobs:
pythonversion:
- "3.7"
name: main
"on":
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- "**.md"
tags-ignore:
- v*
- sdk/*
- '**'
- "**"
48 changes: 29 additions & 19 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ jobs:
name: ${{ env.PROVIDER }}-provider.tar.gz
path: ${{ github.workspace }}/bin
- name: Untar provider binaries
run: |-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin
run: >-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace}}/bin
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
- name: Install plugins
run: make install_plugins
Expand All @@ -71,8 +73,7 @@ jobs:
- name: Check worktree clean
run: ./ci-scripts/ci/check-worktree-is-clean
- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }}
.
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -146,9 +147,11 @@ jobs:
- name: Summarize Provider Coverage Results
run: cat ${{ env.COVERAGE_OUTPUT_DIR }}/shortSummary.txt
- name: Upload coverage data to S3
run: |-
run: >-
summaryName="${PROVIDER}_summary_`date +"%Y-%m-%d_%H-%M-%S"`.json"
s3FullURI="s3://${{ secrets.S3_COVERAGE_BUCKET_NAME }}/summaries/${summaryName}"
aws s3 cp ${{ env.COVERAGE_OUTPUT_DIR }}/summary.json ${s3FullURI} --acl bucket-owner-full-control
strategy:
fail-fast: true
Expand Down Expand Up @@ -262,9 +265,11 @@ jobs:
run: make provider
- if: github.event_name == 'pull_request'
name: Check Schema is Valid
run: |-
run: >-
echo 'SCHEMA_CHANGES<<EOF' >> $GITHUB_ENV
schema-tools compare ${{ env.PROVIDER }} master --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- if: github.event_name == 'pull_request'
name: Comment on PR with Details of Schema Check
Expand All @@ -276,9 +281,9 @@ jobs:
${{ env.SCHEMA_CHANGES }}
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace
}}/bin/ pulumi-resource-${{ env.PROVIDER }} pulumi-tfgen-${{ env.PROVIDER
}}
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
pulumi-tfgen-${{ env.PROVIDER }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -401,21 +406,24 @@ jobs:
name: python-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress python SDK
run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C ${{github.workspace}}/sdk/python
run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C
${{github.workspace}}/sdk/python
- name: Download dotnet SDK
uses: actions/download-artifact@v2
with:
name: dotnet-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress dotnet SDK
run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C ${{github.workspace}}/sdk/dotnet
run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C
${{github.workspace}}/sdk/dotnet
- name: Download nodejs SDK
uses: actions/download-artifact@v2
with:
name: nodejs-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress nodejs SDK
run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C ${{github.workspace}}/sdk/nodejs
run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C
${{github.workspace}}/sdk/nodejs
- run: python -m pip install pip twine
- env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down Expand Up @@ -482,8 +490,10 @@ jobs:
name: ${{ env.PROVIDER }}-provider.tar.gz
path: ${{ github.workspace }}/bin
- name: Untar provider binaries
run: |-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace}}/bin
run: >-
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace}}/bin
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
- run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Download SDK
Expand Down Expand Up @@ -516,8 +526,8 @@ jobs:
with:
repo: haveyoudebuggedit/gotestfmt
- 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
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand All @@ -542,13 +552,13 @@ jobs:
pythonversion:
- "3.7"
name: master
"on":
on:
push:
branches:
- master
paths-ignore:
- '**.md'
- "**.md"
tags-ignore:
- v*
- sdk/*
- '**'
- "**"
Loading

0 comments on commit 2a11c30

Please sign in to comment.