-
Notifications
You must be signed in to change notification settings - Fork 15
68 lines (59 loc) · 1.78 KB
/
backend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: backend
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
go: ['1.15.5']
os: [ubuntu-latest]
name: Go ${{ matrix.go }} test in ${{ matrix.os }}
services:
postgres:
image: postgres:9.6.16
env:
POSTGRES_USER: terminal
POSTGRES_PASSWORD: terminal
POSTGRES_DB: terminal
ports:
- 54321:5432
# needed because the postgres container does not provide a health check
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Environment
run: |
go version
go env
- name: Test
run: make test
- name: Build
run: make build-backend
# after success
# - name: Coverage
# if: startsWith(matrix.os, 'ubuntu')
# run: |
# go get golang.org/x/tools/cmd/cover
# go get github.com/mattn/goveralls
# /home/runner/go/bin/goveralls -coverprofile=coverage.out -service=github-action -repotoken ${{ secrets.COVERALLS_TOKEN }}
release:
name: Release to Github
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'axetroy/wsm'
needs: build
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
files: |
bin/wsm_darwin_amd64.tar.gz
bin/wsm_linux_amd64.tar.gz
bin/wsm_windows_amd64.tar.gz
draft: false