Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
self-hosted-runner:
labels:
- pulumi-ubuntu-8core
21 changes: 16 additions & 5 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ jobs:
OIDC_ARM_CLIENT_ID: ${{ inputs.oidc_arm_client_id }}
run: |
set -euo pipefail
cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd examples && go test -v -json -cover -timeout 2h -tags=${{ matrix.language }} -parallel 16 . 2>&1 | tee /tmp/gotest.log | gotestfmt

- name: Run short tests
if: inputs.short_test
run: |
set -euo pipefail
cd examples && go test -v -json -count=1 -cover -timeout 15m -short -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
cd examples && go test -v -json -cover -timeout 15m -short -tags=${{ matrix.language }} -parallel 16 . 2>&1 | tee /tmp/gotest.log | gotestfmt

- name: Tar SDK folder
if: ${{ matrix.language != 'go' }}
Expand Down Expand Up @@ -207,16 +207,27 @@ jobs:
with:
skip_dotnet_and_java: "true"

- name: Install gotestfmt
uses: jaxxstorm/action-install-gh-release@v1.9.0
with:
tag: v2.4.0
repo: GoTestTools/gotestfmt

- run: make ensure

- name: Prerequisites artifact restore
uses: ./.github/actions/prerequisites-artifact-restore

- name: Mark prerequisites as up-to-date
run: make --touch codegen schema provider
# This is essentially just copying files from bin to the provider folder
- name: Prebuild provider prerequisites
run: |
make --touch codegen schema
make provider_prebuild

- name: Test Provider Library
run: PROVIDER_TEST_TAGS=all make test_provider
run: |
set -euo pipefail
cd provider && go test -v -json -coverprofile="coverage.txt" -coverpkg=./... -timeout 1h -parallel 16 ./... 2>&1 | tee /tmp/gotest.log | gotestfmt

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ PROJECT := github.com/pulumi/pulumi-azure-native
PROVIDER := pulumi-resource-azure-native
CODEGEN := pulumi-gen-azure-native

PROVIDER_PKGS := $(shell cd ./provider && go list ./pkg/...)
WORKING_DIR := $(shell pwd)

# azure-quickstart-templates is generated by arm2pulumi_coverage_report
Expand Down Expand Up @@ -59,9 +58,8 @@ arm2pulumi: bin/$(LOCAL_ARM2PULUMI_FILENAME)
.PHONY: install_provider
install_provider: .make/install_provider

.PHONY: provider_prebuild arm2pulumi_prebuild
.PHONY: provider_prebuild
provider_prebuild: .make/provider_prebuild
arm2pulumi_prebuild: .make/arm2pulumi_prebuild

# We don't include v2 here yet as this is executed on the nightly updates
.PHONY: schema generate_schema generate_docs
Expand Down Expand Up @@ -126,7 +124,7 @@ arm2pulumi_coverage_report: .make/provider_mod_download provider/cmd/$(PROVIDER)
PROVIDER_TEST_TAGS ?= unit # Default to unit tests only for quick local feedback
.PHONY: test_provider
test_provider: .make/provider_mod_download .make/provider_prebuild provider/cmd/$(PROVIDER)/*.go $(PROVIDER_PKG)
cd provider && go test -v --tags=$(PROVIDER_TEST_TAGS) -coverprofile="coverage.txt" -coverpkg=./... $(PROVIDER_PKGS)
cd provider && go test -v --tags=$(PROVIDER_TEST_TAGS) -coverprofile="coverage.txt" -coverpkg=./... ./...

.PHONY: lint_provider
lint_provider: .make/provider_mod_download provider/cmd/$(PROVIDER)/*.go $(PROVIDER_PKG)
Expand Down Expand Up @@ -246,7 +244,7 @@ bin/linux-arm64/arm2pulumi: TARGET := linux-arm64
bin/darwin-amd64/arm2pulumi: TARGET := darwin-amd64
bin/darwin-arm64/arm2pulumi: TARGET := darwin-arm64
bin/windows-amd64/arm2pulumi.exe: TARGET := windows-amd64
bin/%/arm2pulumi bin/%/arm2pulumi.exe: bin/pulumictl .make/provider_mod_download provider/cmd/arm2pulumi/* .make/arm2pulumi_prebuild $(PROVIDER_PKG)
bin/%/arm2pulumi bin/%/arm2pulumi.exe: bin/pulumictl .make/provider_mod_download provider/cmd/arm2pulumi/* .make/provider_prebuild $(PROVIDER_PKG)
cd provider && CGO_ENABLED=0 go build -o $(WORKING_DIR)/$@ $(VERSION_FLAGS) $(PROJECT)/v2/provider/cmd/arm2pulumi

bin/$(CODEGEN): bin/pulumictl .make/provider_mod_download provider/cmd/$(CODEGEN)/* $(PROVIDER_PKG)
Expand Down Expand Up @@ -301,14 +299,11 @@ dist/pulumi-azure-native_$(VERSION_GENERIC)_checksums.txt: dist/$(PROVIDER)-v$(P
cd provider && go mod download
@touch $@

.make/arm2pulumi_prebuild: bin/schema-full.json bin/metadata-compact.json
cp bin/schema-full.json provider/cmd/arm2pulumi
cp bin/metadata-compact.json provider/cmd/arm2pulumi
@touch $@

.make/provider_prebuild: bin/schema-full.json bin/metadata-compact.json
cp bin/schema-full.json provider/cmd/$(PROVIDER)
cp bin/metadata-compact.json provider/cmd/$(PROVIDER)
cp bin/schema-full.json provider/cmd/arm2pulumi
cp bin/metadata-compact.json provider/cmd/arm2pulumi
@touch $@

define FAKE_MODULE
Expand Down
Loading