diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..d2e25a5 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,38 @@ +name: Go +on: [push] +jobs: + test: + name: Test on node ${{ matrix.go_version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + go_version: [1.6, 1.9, 1.12] + os: [ubuntu-latest] + + steps: + - name: Set up Go ${{ matrix.go_version }} + uses: actions/setup-go@v1 + with: + version: ${{ matrix.go_version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@master + path: ${{ go.module-path }} + + - name: Get dependencies + working-directory: ${{ go.module-path }} + run: | + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + + - name: Build + working-directory: ${{ go.module-path }} + run: go build -v . + + - name: Test + working-directory: ${{ go.module-path }} + run: go test -v .