Skip to content

Commit

Permalink
Split go tests into github action
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWeathers committed Jun 27, 2023
1 parent 98a6a62 commit 3014825
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Go

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
build:
timeout-minutes: 30
runs-on: ubuntu-latest

strategy:
matrix:
go-version: [ "1.20" ]

steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Copy swagger docs dummy file
run: mkdir swaggerdocs && cp build/swaggerdocs_dummy.go swaggerdocs/docs.go

- name: Create dummy dist/index.html
run: mkdir dist && touch dist/index.html

- name: Test
run: go test `go list ./... | grep -v swaggerdocs`
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:
- name: Generate swagger docs
run: swag init -g http/http.go -o swaggerdocs

- name: Test
run: go test `go list ./... | grep -v swaggerdocs`
# - name: Test
# run: go test `go list ./... | grep -v swaggerdocs`

- name: Build
run: go build -v .
Expand Down
4 changes: 4 additions & 0 deletions build/swaggerdocs_dummy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package swaggerdocs

func init() {
}

0 comments on commit 3014825

Please sign in to comment.