Skip to content

Commit

Permalink
feature: add github actions as CI to automate workflow (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
khangnkn authored Oct 19, 2020
1 parent a3241c3 commit 8fc87e2
Show file tree
Hide file tree
Showing 4 changed files with 411 additions and 2 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: unit-test

on: [push, pull_request]

jobs:

unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.15.2 # The Go version to download (if necessary) and use.
- run: go test ./...

lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.29

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

release:
name: release
runs-on: ubuntu-latest
needs: [unit-test, lint]
steps:
- name: OSXCross for CGO Support
run: |
mkdir ../../osxcross
git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: 1.15.2
- uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,7 @@ fabric.properties
.idea/caches/build_file_checksums.ser

/tokeny

# VSCode
__debug_bin
.vscode
Loading

0 comments on commit 8fc87e2

Please sign in to comment.