Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
28 changes: 18 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,48 @@
version: 2
version: 2.1
jobs:
build:
working_directory: /go/src/github.com/Mongey/vault-plugin-secrets-kafka
docker:
- image: circleci/golang:1.11
- image: circleci/golang:1.13
environment:
TEST_RESULTS: /tmp/test-results
steps:
- checkout
- run: make build
- store_artifacts:
path: /go/src/github.com/Mongey/vault-plugin-secrets-kafka/vault-plugin-secrets-kafka
destination: vault-plugin-secrets-kafka
test:
working_directory: /go/src/github.com/Mongey/vault-plugin-secrets-kafka
docker:
- image: circleci/golang:1.13
environment:
TEST_RESULTS: /tmp/test-results
- image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
- image: mongey/kafka:5.0.1
- image: mongey/kafka:5.0.1-new-certs
environment:
KAFKA_BROKER_ID: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
KAFKA_LOG_SEGMENT_BYTES: 1234
steps:
- checkout
- run: go build
- store_artifacts:
path: /go/src/github.com/Mongey/vault-plugin-secrets-kafka/vault-plugin-secrets-kafka
destination: vault-plugin-secrets-kafka
- run: make test
- run: go get github.com/jstemmer/go-junit-report
- run: mkdir -p $TEST_RESULTS
- run:
name: Run Tests
command: |
trap "go-junit-report <${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT
make testacc| tee ${TEST_RESULTS}/go-test.out
make test| tee ${TEST_RESULTS}/go-test.out
- store_test_results:
path: /tmp/test-results

workflows:
version: 2
build:
build-and-test:
jobs:
- build
- test
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: release

on:
push:
tags:
- 'v*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
key: ${{ secrets.YOUR_PRIVATE_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

31 changes: 31 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build Snapshots

on:
push:
branches:
- '**'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --snapshot --rm-dist
key: ${{ secrets.YOUR_PRIVATE_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: test

on:
push:
branches:
- '**'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- run: make test
acctest:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go
- name: Bring up kafka + zk
run: docker-compose up -d
- name: "Run tests"
run: |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
go install github.com/jstemmer/go-junit-report
trap "go-junit-report < go-test.out > go-test-report.xml" EXIT
make testacc | tee go-test.out
- name: Upload test results
uses: actions/upload-artifact@v1
with:
name: acc-test-results.xml
path: go-test-report.xml
# Use always() to always run this step to publish test results when there are test failures
if: always()
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vault-plugin-secrets-kafka
sample-app/ca.crt
sample-app/client.crt
sample-app/private.key
19 changes: 19 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
builds:
- binary: "{{ .ProjectName }}_v{{ .Version }}"
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
goarch:
- amd64
- 386
- arm
- arm64
goarm:
- 7
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
12 changes: 12 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
TEST?=$$(go list ./... |grep -v 'vendor')
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
default: build

build:
go build .

test:
go test -i $(TEST) || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

Loading