Skip to content

Commit fb185f7

Browse files
committed
migrate go tests from circleci to github workflow
1 parent 73c8728 commit fb185f7

5 files changed

Lines changed: 51 additions & 6 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Samples Go Clients (Petstore)
2+
3+
on:
4+
push:
5+
paths:
6+
- samples/client/petstore/go/**
7+
- samples/openapi3/client/petstore/go/**
8+
pull_request:
9+
paths:
10+
- samples/client/petstore/go/**
11+
- samples/openapi3/client/petstore/go/**
12+
13+
jobs:
14+
build:
15+
name: Build Go
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
sample:
21+
- samples/client/petstore/go/
22+
- samples/openapi3/client/petstore/go/
23+
steps:
24+
- uses: actions/checkout@v5
25+
- uses: actions/setup-go@v6
26+
- run: go version
27+
- name: Install Dependencies
28+
working-directory: ${{ matrix.sample }}
29+
run: |
30+
go mod tidy
31+
- name: Run test
32+
working-directory: ${{ matrix.sample }}
33+
run: go test -mod=mod -v
34+

.github/workflows/samples-go-client.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ on:
66
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
77
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
88
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
9+
- samples/client/others/go/allof_multiple_ref_and_discriminator/**
10+
- samples/client/others/go/oneof-anyof-required/**
11+
- samples/client/others/go/oneof-required/**
12+
- samples/client/others/go/oneof-discriminator-lookup/**
913
pull_request:
1014
paths:
1115
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
1216
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
1317
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
14-
18+
- samples/client/others/go/allof_multiple_ref_and_discriminator/**
19+
- samples/client/others/go/oneof-anyof-required/**
20+
- samples/client/others/go/oneof-required/**
21+
- samples/client/others/go/oneof-discriminator-lookup/**
1522
jobs:
1623
build:
1724
name: Build Go
@@ -23,6 +30,10 @@ jobs:
2330
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/'
2431
- 'samples/openapi3/client/petstore/go-petstore-withXml/'
2532
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/
33+
- samples/client/others/go/allof_multiple_ref_and_discriminator/
34+
- samples/client/others/go/oneof-anyof-required/
35+
- samples/client/others/go/oneof-required/
36+
- samples/client/others/go/oneof-discriminator-lookup/
2637
steps:
2738
- uses: actions/checkout@v5
2839
- uses: actions/setup-go@v6

CI/circle_parallel.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ elif [ "$NODE_INDEX" = "2" ]; then
5656
sudo ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true
5757
source ~/.cpprc # activate cpp environment variables
5858

59-
# run go integration tests
60-
(cd samples/client/petstore/go && mvn integration-test)
61-
(cd samples/openapi3/client/petstore/go && mvn integration-test)
62-
(cd samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false && mvn integration-test)
63-
(cd samples/client/others/go/allof_multiple_ref_and_discriminator && mvn integration-test)
6459
(cd samples/client/petstore/cpp-restsdk/client && mvn integration-test)
6560

6661
elif [ "$NODE_INDEX" = "3" ]; then

samples/openapi3/client/petstore/go/go-petstore-aws-signature/.openapi-generator-ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
#docs/*.md
2222
# Then explicitly reverse the ignore rule for a single file:
2323
#!docs/README.md
24+
#
25+
#
26+
#

samples/openapi3/client/petstore/go/go-petstore/.openapi-generator-ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@
2121
#docs/*.md
2222
# Then explicitly reverse the ignore rule for a single file:
2323
#!docs/README.md
24+
#
25+
#

0 commit comments

Comments
 (0)