Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add tests execution and TF provider support #177

Merged
merged 4 commits into from
Nov 7, 2024
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
25 changes: 16 additions & 9 deletions .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,40 @@ jobs:
name: Generate code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Download Go dependencies
run: go get ./... && go mod tidy

- name: Test codegen
run: go test -v ./...

- name: Build codegen
run: go build -v ./...

- name: Execute codegen for PANGO SDK
run: go run cmd/codegen/main.go -t mksdk
- name: Execute codegen for all targets
run: go run cmd/codegen/main.go

- name: List generated PANGO SDK files
- name: Test generated code
run: |
echo "Generated Files:"
ls ../generated/pango
for dir in $(ls ../generated); do
echo "Run tests for ${dir}"
cd ../generated/${dir}
go test -v ./...
cd -
done

- name: Workaround actions/upload-artifact#176
run: |
echo "artifacts_path=$(realpath ../generated/pango)" >> $GITHUB_ENV

- name: Upload generated files for PANGO SDK
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
- name: Upload generated files for pango SDK
uses: actions/upload-artifact@v4
with:
name: generated-pango
path: |
Expand Down
4 changes: 2 additions & 2 deletions assets/terraform/internal/manager/uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ var _ = Describe("Server", func() {
manager = sdkmanager.NewUuidObjectManager(client, service, MockUuidSpecifier, MockUuidMatcher)

})
FIt("should move the entries in order", func() {
It("should move the entries in order", func() {
entries := []*MockUuidObject{{Name: "1", Value: "A"}, {Name: "3", Value: "C"}, {Name: "2", Value: "B"}}

processed, err := manager.ReadMany(ctx, location, entries, sdkmanager.NonExhaustive)
Expand All @@ -173,7 +173,7 @@ var _ = Describe("Server", func() {
Expect(err).ToNot(HaveOccurred())
Expect(processed).To(HaveLen(3))

Expect(processed).NotTo(Equal(entries))
Expect(processed).To(Equal(entries))
})
})
})
Expand Down