From 60a3f37f09c38dd1446a48d1ee5feb8166ab38c0 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sat, 30 May 2020 22:58:15 +0100 Subject: [PATCH] Merge github actions and add docker-compose deploy and integration test --- .github/workflows/docker-image.yml | 34 ++++++++++++++++++++++++--- .github/workflows/go.yml | 37 ------------------------------ 2 files changed, 31 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8e004d5..ba7c1f9 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -9,10 +9,38 @@ on: jobs: build: - + name: Build and Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Build the Docker image + - 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 with go + run: go build -v ./... + + - name: Unit Tests + run: go test -v ./... + + - name: Build docker run: docker build . --tag rove:$(date +%s) + + - name: Deploy docker-compose + run: docker-compose up --build + + - name: Run integration tests + run: go test ./... -tags integration diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 108a0c7..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Go And Tests - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - - build: - name: Build - runs-on: ubuntu-latest - 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 ./...