William Cheng 3a63c2f7d2
Migrate Go petstore tests from circleci to github workflow (#21997)
* migrate go tests from circleci to github workflow

* update samples

* update samples

* update workflow

* update samples

* update samples

* update test

* update tests

* update tests

* fix

* fix

* update host table

* update tests

* update spec

* new spec
2025-09-19 17:10:31 +08:00

46 lines
1.8 KiB
YAML

name: Samples Go Clients
on:
push:
paths:
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
- samples/client/others/go/allof_multiple_ref_and_discriminator/**
- samples/client/others/go/oneof-anyof-required/**
- samples/client/others/go/oneof-discriminator-lookup/**
pull_request:
paths:
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
- 'samples/openapi3/client/petstore/go-petstore-withXml/**'
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/**
- samples/client/others/go/allof_multiple_ref_and_discriminator/**
- samples/client/others/go/oneof-anyof-required/**
- samples/client/others/go/oneof-discriminator-lookup/**
jobs:
build:
name: Build Go
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sample:
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/'
- 'samples/openapi3/client/petstore/go-petstore-withXml/'
- samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/
- samples/client/others/go/allof_multiple_ref_and_discriminator/
- samples/client/others/go/oneof-anyof-required/
- samples/client/others/go/oneof-discriminator-lookup/
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
- run: go version
- name: Install Dependencies
working-directory: ${{ matrix.sample }}
run: |
go mod tidy
- name: Run test
working-directory: ${{ matrix.sample }}
run: go test -mod=mod -v