From aa16e08b497b7b1132d0e46fcfe7a009d28c49de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Strate=20Kl=C3=B8vedal?= Date: Tue, 23 Jun 2020 17:10:53 +0200 Subject: [PATCH] Setup automated testing of API --- .github/workflows/api.yml | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/api.yml diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml new file mode 100644 index 00000000..7d466959 --- /dev/null +++ b/.github/workflows/api.yml @@ -0,0 +1,42 @@ +name: API + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + + defaults: + run: + working-directory: api + + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + 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 + run: go build -v . + + - name: Test + run: go test -v ./...