Skip to content

Add go test action

Add go test action #1

Workflow file for this run

name: go-test
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Download Go
uses: actions/setup-go@v2
with:
go-version: 1.21
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Build
env:
GOPROXY: "https://proxy.golang.org"
run: go build -o $@ leader ./cmd/$@
- name: Test
env:
GOPROXY: "https://proxy.golang.org"
working-directory: ./leader
run: go test -v ./...