From 3014825f825efefc287beab8f0e32ab3b7a7f6c2 Mon Sep 17 00:00:00 2001 From: Steven Weathers Date: Tue, 27 Jun 2023 00:30:05 -0400 Subject: [PATCH] Split go tests into github action --- .github/workflows/go-test.yml | 35 +++++++++++++++++++++++++++++++++++ .github/workflows/go.yml | 4 ++-- build/swaggerdocs_dummy.go | 4 ++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/go-test.yml create mode 100644 build/swaggerdocs_dummy.go diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml new file mode 100644 index 00000000..6fa4f39a --- /dev/null +++ b/.github/workflows/go-test.yml @@ -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` \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 790d85a8..a61f99fb 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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 . diff --git a/build/swaggerdocs_dummy.go b/build/swaggerdocs_dummy.go new file mode 100644 index 00000000..ebacd5f5 --- /dev/null +++ b/build/swaggerdocs_dummy.go @@ -0,0 +1,4 @@ +package swaggerdocs + +func init() { +}