Skip to content

Commit 39fbd97

Browse files
committed
feat(ci): migrate to github actions
1 parent de07f04 commit 39fbd97

File tree

16 files changed

+105
-760
lines changed

16 files changed

+105
-760
lines changed

.github/workflows/go.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
11+
build:
12+
runs-on: ubuntu-latest
13+
services:
14+
postgres:
15+
image: postgres:11.6-alpine
16+
env:
17+
# POSTGRES_PASSWORD: password
18+
POSTGRES_DB: gonode
19+
ports:
20+
- 5432:5432
21+
# needed because the postgres container does not provide a healthcheck
22+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v2
29+
with:
30+
go-version: 1.15
31+
32+
- name: Install
33+
run: |
34+
#go get github.com/wadey/gocovmerge
35+
go get github.com/mattn/goveralls
36+
#go get golang.org/x/tools/cmd/cover
37+
#go get golang.org/x/tools/cmd/goimports
38+
go get -u github.com/jteeuwen/go-bindata/...
39+
./app/assets/bindata.sh
40+
go get ./...
41+
42+
- name: Test
43+
run: |
44+
make test
45+
46+
- name: Convert coverage to lcov
47+
uses: jandelgado/[email protected]
48+
with:
49+
infile: data/coverage.out
50+
outfile: data/coverage.lcov
51+
52+
- name: Coveralls
53+
uses: coverallsapp/github-action@master
54+
with:
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
path-to-lcov: data/coverage.lcov

.travis.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ install:
1212

1313
test:
1414
./app/assets/bindata.sh
15-
echo "mode: atomic" > data/coverage.out
1615
mkdir -p data
16+
echo "mode: atomic" > data/coverage.out
1717

1818
GONODE_TEST_OFFLINE=true GOPATH=${GOPATH} go test -v -failfast -covermode=atomic -coverprofile=data/coverage_core.out $(GONODE_CORE)
1919
GOPATH=${GOPATH} go test -v -failfast -covermode=atomic -coverprofile=data/coverage_modules.out $(GONODE_MODULES)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Go Node
22
=======
33

4-
[![Build Status](https://travis-ci.org/rande/gonode.svg?branch=master)](https://travis-ci.org/rande/gonode)
4+
[![Build Status](https://github.com/rande/gonode/actions/workflows/go.yml/badge.svg)](https://github.com/rande/gonode/actions/workflows/go.yml)
55
[![Coverage Status](https://coveralls.io/repos/github/rande/gonode/badge.svg)](https://coveralls.io/github/rande/gonode)
66

77
A prototype to store dynamic node inside a PostgreSQL database with the JSONb storage column.

app/assets/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,26 @@ Please note, the ``go-bindata`` must be run from ``GOPATH`` folder, so the asset
1818
The ``Makefile`` lines to generate the file will be:
1919

2020
```Makefile
21+
GO_PATH = $(shell go env GOPATH)
22+
GO_BINDATA_PATHS = $(GO_PATH)/src/github.com/rande/gonode/modules/... $(GO_PATH)/src/github.com/rande/gonode/explorer/dist/...
23+
GO_BINDATA_IGNORE = "(.*)\.(go|DS_Store)"
24+
GO_BINDATA_OUTPUT = $(GO_PATH)/src/github.com/rande/gonode/assets/bindata.go
25+
GO_BINDATA_PACKAGE = assets
2126

2227
bin:
23-
app/assets/bindata.sh
28+
cd $(GO_PATH)/src && go-bindata -debug -o $(GO_BINDATA_OUTPUT) -pkg $(GO_BINDATA_PACKAGE) -ignore $(GO_BINDATA_IGNORE) $(GO_BINDATA_PATHS)
2429

2530
run: bin
26-
go run app/main.go server -config=app/server.toml.dist
31+
cd commands && go run main.go server -config=../server.toml.dist
2732

28-
build: bin
33+
build:
2934
rm -rf dist && mkdir dist
30-
app/assets/bindata.sh
31-
go build -a -o ./dist/gonode app/main.go
35+
cd $(GO_PATH)/src && go-bindata -o $(GO_BINDATA_OUTPUT) -pkg $(GO_BINDATA_PACKAGE) -ignore $(GO_BINDATA_IGNORE) $(GO_BINDATA_PATHS)
36+
cd commands && go build -a -o ../dist/gonode
3237

3338

3439
Usage
3540
-----
3641

3742
Just import the package ``assets`` and refer to the ``go-bindata`` documentation.
43+

app/assets/bindata.sh

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
11
#!/usr/bin/env bash
22

33
GOPATH=`go env GOPATH`
4-
GO_BINDATA_PATHS="${GOPATH}/src/github.com/rande/gonode/modules/..."
5-
GO_BINDATA_IGNORE="(.*)\.(go|DS_Store)"
6-
GO_BINDATA_OUTPUT="${GOPATH}/src/github.com/rande/gonode/app/assets/bindata.go"
4+
#GO_BINDATA_PATHS="${GOPATH}/src/github.com/rande/gonode/modules/..."
5+
if [ -d ${GOPATH}/src/github.com/rande/gonode/modules ]; then
6+
GO_BINDATA_PATHS="${GOPATH}/src/github.com/rande/gonode/modules/..."
7+
GO_BINDATA_OUTPUT="${GOPATH}/src/github.com/rande/gonode/app/assets/bindata.go"
8+
GO_BINDATA_PREFIX="${GOPATH}/src/github.com/rande/gonode"
9+
else
10+
GO_BINDATA_PATHS="./modules/..."
11+
GO_BINDATA_OUTPUT="./app/assets/bindata.go"
12+
GO_BINDATA_PREFIX=`pwd`
13+
fi
14+
15+
GO_BINDATA_IGNORE="(.*)\.(go|DS_Store|jpg)"
716
GO_BINDATA_PACKAGE="assets"
817

18+
919
echo "Generating bindata file..."
10-
cd ${GOPATH}/src && ${GOPATH}/bin/go-bindata -dev -prefix ${GOPATH}/src -o ${GO_BINDATA_OUTPUT} -pkg ${GO_BINDATA_PACKAGE} -ignore ${GO_BINDATA_IGNORE} ${GO_BINDATA_PATHS}
20+
echo "GO_BINDATA_PATHS=${GO_BINDATA_PATHS}"
21+
echo "GO_BINDATA_IGNORE=${GO_BINDATA_IGNORE}"
22+
echo "GO_BINDATA_OUTPUT=${GO_BINDATA_OUTPUT}"
23+
echo "GO_BINDATA_PACKAGE=${GO_BINDATA_PACKAGE}"
24+
echo "GO_BINDATA_PREFIX=${GO_BINDATA_PREFIX}"
25+
26+
${GOPATH}/bin/go-bindata \
27+
-debug \
28+
-prefix ${GO_BINDATA_PREFIX}/ \
29+
-o ${GO_BINDATA_OUTPUT} \
30+
-pkg ${GO_BINDATA_PACKAGE} \
31+
-ignore ${GO_BINDATA_IGNORE} \
32+
${GO_BINDATA_PATHS}
1133

1234
echo "Done!"

assets/README.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

assets/assets.go

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)