From a83a7b7c0f96b96747a51735ac53aa96b8ddde08 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Sat, 30 Nov 2019 10:13:19 +0800 Subject: [PATCH] Use github actions --- .github/workflows/main.yml | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..1927bb03 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,61 @@ +name: Test +on: + push: + branches: + - master + pull_request: + +jobs: + + lint: + name: Lint + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + go_version: [1.11.x, 1.12.x, 1.13.x, master] + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go_version }} + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Lint Go code + run: | + go get -u golang.org/x/lint/golint + go get -u github.com/client9/misspell/cmd/misspell + make vet + make fmt-check + make misspell-check + + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + go_version: [1.11.x, 1.12.x, 1.13.x, master] + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go_version }} + + - name: Check out code + uses: actions/checkout@v1 + + - name: Run Unit tests. + run: make test + + - name: Upload Coverage report to CodeCov + uses: codecov/codecov-action@v1.0.0 + with: + token: ${{secrets.CODECOV_TOKEN}} + file: ./coverage.txt