Skip to content

Commit

Permalink
[internal] Update GitHub Actions workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
pulumi-bot committed Mar 27, 2024
1 parent 00fbadd commit 060e157
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 23 deletions.
47 changes: 41 additions & 6 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ jobs:
- dotnet
- go
- java

generate_coverage_data:
continue-on-error: true
env:
Expand Down Expand Up @@ -214,12 +215,15 @@ jobs:
ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Prepare upstream code
run: make upstream
- name: Install Go
uses: actions/setup-go@v5
with:
cache-dependency-path: |
sdk/go.sum
go-version: 1.21.x
cache-dependency-path: |
provider/*.sum
upstream/*.sum
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
Expand All @@ -234,8 +238,14 @@ jobs:
uses: jaxxstorm/[email protected]
with:
repo: pulumi/schema-tools
- name: Build tfgen & provider binaries
run: make provider
- name: Build schema generator binary
run: make tfgen_build_only
- name: Install plugins
run: make install_plugins
- name: Generate schema
run: make tfgen_no_deps
- name: Build provider binary
run: make provider_no_deps
- name: Unit-test provider code
run: make test_provider
- if: github.event_name == 'pull_request'
Expand All @@ -262,6 +272,33 @@ jobs:
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes.
- if: github.event_name == 'pull_request'
name: Check Configuration section
run: |
sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt
jq -r '.config[] | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
{
echo "MISSING_CONFIG<<$EOF";
xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt
echo "$EOF";
} >> "$GITHUB_ENV"
- if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
name: Comment on PR with Details of Configuration check
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment_tag: configurationCheck
message: >+
### Is README.md missing any configuration options?
${{ env.MISSING_CONFIG || 'No missing config!' }}
${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }}
${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }}
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
Expand Down Expand Up @@ -496,5 +533,3 @@ on:
- v*
- sdk/*
- "**"

# Ensure diff with ci-mgmt
46 changes: 42 additions & 4 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ jobs:
with:
name: ${{ matrix.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz
retention-days: 30
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand All @@ -130,6 +131,7 @@ jobs:
- dotnet
- go
- java

lint:
name: lint
uses: ./.github/workflows/lint.yml
Expand All @@ -152,12 +154,15 @@ jobs:
ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Prepare upstream code
run: make upstream
- name: Install Go
uses: actions/setup-go@v5
with:
cache-dependency-path: |
sdk/go.sum
go-version: 1.21.x
cache-dependency-path: |
provider/*.sum
upstream/*.sum
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
Expand All @@ -172,8 +177,14 @@ jobs:
uses: jaxxstorm/[email protected]
with:
repo: pulumi/schema-tools
- name: Build tfgen & provider binaries
run: make provider
- name: Build schema generator binary
run: make tfgen_build_only
- name: Install plugins
run: make install_plugins
- name: Generate schema
run: make tfgen_no_deps
- name: Build provider binary
run: make provider_no_deps
- name: Unit-test provider code
run: make test_provider
- if: github.event_name == 'pull_request'
Expand All @@ -200,6 +211,33 @@ jobs:
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes.
- if: github.event_name == 'pull_request'
name: Check Configuration section
run: |
sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt
jq -r '.config[] | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
{
echo "MISSING_CONFIG<<$EOF";
xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt
echo "$EOF";
} >> "$GITHUB_ENV"
- if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
name: Comment on PR with Details of Configuration check
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment_tag: configurationCheck
message: >+
### Is README.md missing any configuration options?
${{ env.MISSING_CONFIG || 'No missing config!' }}
${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }}
${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }}
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
Expand Down
46 changes: 42 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ jobs:
with:
name: ${{ matrix.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz
retention-days: 30
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
Expand All @@ -129,6 +130,7 @@ jobs:
- dotnet
- go
- java

create_docs_build:
name: create_docs_build
needs: tag_sdk
Expand Down Expand Up @@ -166,12 +168,15 @@ jobs:
ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Prepare upstream code
run: make upstream
- name: Install Go
uses: actions/setup-go@v5
with:
cache-dependency-path: |
sdk/go.sum
go-version: 1.21.x
cache-dependency-path: |
provider/*.sum
upstream/*.sum
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
Expand All @@ -186,8 +191,14 @@ jobs:
uses: jaxxstorm/[email protected]
with:
repo: pulumi/schema-tools
- name: Build tfgen & provider binaries
run: make provider
- name: Build schema generator binary
run: make tfgen_build_only
- name: Install plugins
run: make install_plugins
- name: Generate schema
run: make tfgen_no_deps
- name: Build provider binary
run: make provider_no_deps
- name: Unit-test provider code
run: make test_provider
- if: github.event_name == 'pull_request'
Expand All @@ -214,6 +225,33 @@ jobs:
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes.
- if: github.event_name == 'pull_request'
name: Check Configuration section
run: |
sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt
jq -r '.config[] | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
{
echo "MISSING_CONFIG<<$EOF";
xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt
echo "$EOF";
} >> "$GITHUB_ENV"
- if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
name: Comment on PR with Details of Configuration check
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment_tag: configurationCheck
message: >+
### Is README.md missing any configuration options?
${{ env.MISSING_CONFIG || 'No missing config!' }}
${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }}
${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }}
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
Expand Down
45 changes: 41 additions & 4 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ jobs:
- dotnet
- go
- java

comment-notification:
if: github.event_name == 'repository_dispatch'
name: comment-notification
Expand Down Expand Up @@ -177,12 +178,15 @@ jobs:
ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Prepare upstream code
run: make upstream
- name: Install Go
uses: actions/setup-go@v5
with:
cache-dependency-path: |
sdk/go.sum
go-version: 1.21.x
cache-dependency-path: |
provider/*.sum
upstream/*.sum
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
Expand All @@ -197,8 +201,14 @@ jobs:
uses: jaxxstorm/[email protected]
with:
repo: pulumi/schema-tools
- name: Build tfgen & provider binaries
run: make provider
- name: Build schema generator binary
run: make tfgen_build_only
- name: Install plugins
run: make install_plugins
- name: Generate schema
run: make tfgen_no_deps
- name: Build provider binary
run: make provider_no_deps
- name: Unit-test provider code
run: make test_provider
- if: github.event_name == 'pull_request'
Expand All @@ -225,6 +235,33 @@ jobs:
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes.
- if: github.event_name == 'pull_request'
name: Check Configuration section
run: |
sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt
jq -r '.config[] | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
{
echo "MISSING_CONFIG<<$EOF";
xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt
echo "$EOF";
} >> "$GITHUB_ENV"
- if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
name: Comment on PR with Details of Configuration check
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment_tag: configurationCheck
message: >+
### Is README.md missing any configuration options?
${{ env.MISSING_CONFIG || 'No missing config!' }}
${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }}
${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }}
- name: Tar provider binaries
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }}
Expand Down
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,14 @@ test_provider:
@echo ""
cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM)

tfgen: export PULUMI_HOME := $(WORKING_DIR)/.pulumi
tfgen: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH)
tfgen: install_plugins upstream
(cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN))
PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER)
tfgen: install_plugins upstream tfgen_no_deps

tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi
tfgen_no_deps: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH)
tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT)
tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT)
tfgen_no_deps: tfgen_build_only
$(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER)
(cd provider && VERSION=$(VERSION) go generate cmd/$(PROVIDER)/main.go)

tfgen_build_only:
Expand Down

0 comments on commit 060e157

Please sign in to comment.