Skip to content

Commit

Permalink
Add CI tests using Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
skateinmars committed Jun 22, 2021
1 parent a80b748 commit ecea6a0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on: [push, pull_request]
name: Test
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.15.x, 1.16.x]

services:
etc:
image: quay.io/coreos/etcd
ports:
- 2379:2379
env:
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
consul:
image: consul
ports:
- 8500:8500
vault096:
image: vault:0.9.6
ports:
- 8200:8200
env:
VAULT_DEV_ROOT_TOKEN_ID: root
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
vault010:
image: vault:0.10.0
ports:
- 8222:8200
env:
VAULT_DEV_ROOT_TOKEN_ID: root
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: make test
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VAULT_ADDR ?= http://127.0.0.1:8200

.PHONY: test

test:
go build
VAULT_ADDR="$(VAULT_ADDR)" \
go test -v -race -cover -timeout=1m ./... && echo OK || (echo FAIL && exit 1)

0 comments on commit ecea6a0

Please sign in to comment.