Skip to content

Commit 41cf77b

Browse files
author
Gregory Hill
committed
use github actions
Signed-off-by: Gregory Hill <[email protected]>
1 parent 6a2b6c0 commit 41cf77b

File tree

10 files changed

+164
-134
lines changed

10 files changed

+164
-134
lines changed

.circleci/config.yml

-92
This file was deleted.
File renamed without changes.

.github/workflows/main.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: main
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
name: Test
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/setup-go@v1
9+
with:
10+
go-version: 1.12
11+
id: go
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: '8.x'
15+
- uses: actions/checkout@v1
16+
- run: make build
17+
- run: make test
18+
- run: npm install
19+
- run: make test_js
20+
21+
docker:
22+
name: Docker
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v1
26+
- run: make docker_build

.github/workflows/master.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: master
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
cover:
9+
name: Integration
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/setup-go@v1
13+
with:
14+
go-version: 1.12
15+
id: go
16+
- uses: actions/checkout@v1
17+
- run: echo $GCLOUD_SERVICE_KEY > /tmp/gcloud-service-key.json
18+
env:
19+
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
20+
- run: gcloud auth activate-service-account --key-file=/tmp/gcloud-service-key.json
21+
- run: make test_integration

.github/workflows/release.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
jobs:
8+
go:
9+
name: GoReleaser
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Publish
14+
uses: docker://goreleaser/goreleaser
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
with:
18+
args: release --release-notes "NOTES.md"
19+
if: success()
20+
21+
js:
22+
name: NPM
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v1
26+
- name: Publish
27+
env:
28+
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
29+
NPM_USER: ${{ secrets.NPM_USER }}
30+
NPM_PASS: ${{ secrets.NPM_PASS }}
31+
run: |
32+
git config --global user.email "${NPM_EMAIL}"
33+
npm-cli-login
34+
npm version from-git
35+
npm publish --access public .
36+
37+
docker:
38+
name: Docker
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v1
42+
- run: make docker_build
43+
- name: Publish
44+
env:
45+
DOCKER_REPO: "quay.io/monax/hoard"
46+
DOCKER_USER: ${{ secrets.DOCKER_USER }}
47+
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
48+
run: |
49+
export tag=$(git tag --points-at HEAD)
50+
echo ${DOCKER_PASS} | docker login --username ${DOCKER_USER} --password-stdin
51+
docker tag ${DOCKER_REPO}:${tag#v} ${DOCKER_REPO}:latest
52+
docker push ${DOCKER_REPO}

Makefile

+4-6
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export BUILD_IMAGE := $(DOCKER_REPO):build
3939
.PHONY: check
4040
check:
4141
@echo "Checking code for formatting style compliance."
42-
@goimports -l -d ${GOFILES}
43-
@goimports -l ${GOFILES} | read && echo && echo "Your marmot has found a problem with the formatting style of the code." 1>&2 && exit 1 || true
42+
@gofmt -l -d ${GOFILES}
43+
@gofmt -l ${GOFILES} | read && echo && echo "Your marmot has found a problem with the formatting style of the code." 1>&2 && exit 1 || true
4444

4545
## just fix it
4646
.PHONY: fix
@@ -100,7 +100,7 @@ install:
100100

101101
## build all targets in github.com/monax/hoard
102102
.PHONY: build
103-
build: check build_hoard build_hoarctl
103+
build: check build_hoard build_hoarctl
104104

105105
.PHONY: docker_build
106106
docker_build: commit_hash
@@ -119,9 +119,7 @@ test: check
119119

120120
.PHONY: test_js
121121
test_js: build install
122-
$(eval HID := $(shell hoard config memory -s test:secret_pass | hoard -c- &> /dev/null & echo $$!))
123-
npm test
124-
kill ${HID}
122+
@scripts/test_js.sh
125123

126124
## run tests including integration tests
127125
.PHONY: test_integration

go.mod

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/monax/hoard/v5
22

3-
go 1.12
3+
go 1.13
4+
5+
replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999
46

57
require (
68
cloud.google.com/go v0.37.0
@@ -10,16 +12,20 @@ require (
1012
github.com/aws/aws-sdk-go v1.19.35
1113
github.com/cep21/xdgbasedir v0.0.0-20170329171747-21470bfc93b9
1214
github.com/eapache/channels v1.1.0
13-
github.com/go-kit/kit v0.8.0
15+
github.com/go-kit/kit v0.9.0
16+
github.com/go-logfmt/logfmt v0.4.0 // indirect
1417
github.com/go-stack/stack v1.8.0
15-
github.com/gogo/protobuf v1.2.1
18+
github.com/gogo/protobuf v1.3.0
1619
github.com/jawher/mow.cli v1.1.0
1720
github.com/monax/relic v2.0.0+incompatible
18-
github.com/stretchr/testify v1.3.0
21+
github.com/stretchr/testify v1.4.0
1922
gocloud.dev v0.13.0
20-
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f
23+
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392
24+
golang.org/x/net v0.0.0-20190921015927-1a5e07d1ff72 // indirect
2125
golang.org/x/oauth2 v0.0.0-20190517181255-950ef44c6e07
26+
golang.org/x/text v0.3.2 // indirect
2227
google.golang.org/api v0.2.0
23-
google.golang.org/grpc v1.20.1
28+
google.golang.org/genproto v0.0.0-20190916214212-f660b8655731 // indirect
29+
google.golang.org/grpc v1.23.1
2430
gopkg.in/yaml.v2 v2.2.2
2531
)

0 commit comments

Comments
 (0)