Skip to content

Commit

Permalink
enable github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhiwei committed Aug 21, 2021
1 parent 85d9117 commit 5ee3cfa
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/pr.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PR - run test
on:
pull_request

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:

- name: checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: setup golang
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: make test
run: make test
35 changes: 35 additions & 0 deletions .github/workflows/push.build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PUSH - build and release
on:
push:
branches:
- master
tags:
- "*"

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:

- name: checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: setup golang
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: make test
run: make test

- name: make build
run: make build

- name: create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: bin/certctl
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ build:
$(GOBUILD) -o $(BINDIR)/$(NAME)
@strip $(BINDIR)/$(NAME) || true

test:
fmt:
go fmt ./...

vet:
go vet ./...

test: fmt vet
go test ./pkg/cert

0 comments on commit 5ee3cfa

Please sign in to comment.