-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from yahoo/gh-actions
use gh actions
- Loading branch information
Showing
4 changed files
with
91 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Linux | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: [ '1.14.2', '1.13' ] | ||
name: Go ${{ matrix.go }} build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: go vet | ||
run: go vet -v ./... | ||
|
||
- name: Basic build | ||
run: go build ./cmd/... | ||
|
||
- name: Run tests on linux | ||
run: go test ./... | ||
|
||
- name: Run tests with race detector | ||
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: create release and upload binary | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: install go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14.x | ||
|
||
- name: checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: get version | ||
id: v | ||
run: echo ::set-output name=tag::$( awk -F '/' '{print $NF}' <<< "${GITHUB_REF}" ) | ||
|
||
- name: build | ||
run: | | ||
go build ./cmd/crypki | ||
tar -czvf crypki-${{ steps.v.outputs.tag }}-linux.tar.gz --transform 's,^,crypki-${{ steps.v.outputs.tag }}-${OS}/,' crypki | ||
- name: create release | ||
id: create-release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.v.outputs.tag }} | ||
release_name: ${{ steps.v.outputs.tag }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: upload linux binary | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create-release.outputs.upload_url }} | ||
asset_path: crypki-${{ steps.v.outputs.tag }}-linux.tar.gz | ||
asset_name: crypki-${{ steps.v.outputs.tag }}-linux.tar.gz | ||
asset_content_type: application/gzip |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters