Skip to content

Commit 047740d

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

File tree

16 files changed

+100
-760
lines changed

16 files changed

+100
-760
lines changed

.github/workflows/go.yml

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