Compare commits

...

8 Commits

Author SHA1 Message Date
William Cheng
37cf47fa2c remove go.sum 2022-02-20 22:58:15 +08:00
William Cheng
b1d7fef226 add go.sum 2022-02-20 22:58:04 +08:00
William Cheng
cf59f55334 trigger build 2022-02-20 22:37:26 +08:00
William Cheng
006c5edce3 fix path 2022-02-20 22:36:55 +08:00
William Cheng
880785121a add test.bash 2022-02-20 22:29:39 +08:00
William Cheng
650f2ebc4d add more go server tests 2022-02-20 22:21:29 +08:00
William Cheng
f30fb46b52 trigger build 2022-02-20 22:14:55 +08:00
William Cheng
69e7735b0c add workflow for go server 2022-02-20 22:14:19 +08:00
6 changed files with 46 additions and 3 deletions

29
.github/workflows/samples-go.yaml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Samples Go
on:
push:
paths:
- 'samples/server/petstore/go*/**'
pull_request:
paths:
- 'samples/server/petstore/go*/**'
jobs:
build:
name: Build Go
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sample:
- samples/server/petstore/go-gin-api-server
- samples/server/petstore/go-api-server
- samples/server/petstore/go-echo-server
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.17.1'
- name: Build and Test
working-directory: ${{ matrix.sample }}
run: ./test.bash

View File

@ -1297,9 +1297,6 @@
<!-- test Go projects -->
<module>samples/client/petstore/go</module>
<module>samples/openapi3/client/petstore/go</module>
<module>samples/server/petstore/go-api-server</module>
<module>samples/server/petstore/go-gin-api-server</module>
<module>samples/server/petstore/go-echo-server</module>
</modules>
</profile>
<profile>

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
go test -v

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
go mod download && go build -o app

View File

@ -0,0 +1,5 @@
module github.com/GIT_USER_ID/GIT_REPO_ID
go 1.17
require github.com/gin-gonic/gin v1.7.7

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
go get github.com/gin-gonic/gin && go test -v