diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..3b198d15 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,40 @@ +name: Go + +on: + workflow_dispatch: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + go-version: [ '1.17', '1.18', '1.19' ] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + + - name: Build + run: go build -v ./... + working-directory: server + + - name: Test + run: go test -v ./... + working-directory: server + + - name: Run coverage + run: go test -race -coverprofile=coverage.out -covermode=atomic + working-directory: server + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3