misc changes to support functional tests in github actions workflow #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DGate Build/Test/Bench | |
on: | |
push: | |
branches: [ "**" ] | |
jobs: | |
build_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: go.mod | |
cache: true | |
cache-dependency-path: go.sum | |
- name: Build & Install | |
run: | | |
go mod download | |
go build -v ./... | |
- name: Install dgate-cli and dgate-server | |
run: | | |
go install github.com/dgate-io/dgate/cmd/dgate-cli | |
dgate-cli --version | |
go install github.com/dgate-io/dgate/cmd/dgate-server | |
dgate-server --version | |
- name: Test | |
run: | | |
go test -coverprofile=cov.out -v ./... | |
go tool cover -func=cov.out | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: dgate-io/dgate | |
- name: Benchmark | |
run: | | |
go test -bench=. -run=^# ./... |