You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- # This is a basic workflow to help you get started with Actions
-
- name: CI
-
- # Controls when the action will run. Triggers the workflow on push or pull request
- # events for all branches and tags
- on:
- push:
- branches: [ '**' ]
- pull_request:
- branches: [ '**' ]
-
- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
- jobs:
- # This workflow contains a single job called "lint"
- lint-and-test:
- strategy:
- matrix:
- go-version: [ 1.15.x ]
-
- # The type of runner that the job will run on
- runs-on: ubuntu-latest
-
- # Steps represent a sequence of tasks that will be executed as part of the job
- steps:
- - name: Set up Go
- uses: actions/setup-go@v2
- with:
- go-version: ${{ matrix.go-version }}
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - name: Checkout code
- uses: actions/checkout@v2
-
- - name: Go Build
- run: |
- go build ./...
-
- - name: Go Vet
- run: |
- go vet -v ./...
-
- - name: GolangCI Lint
- run: |
- go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.39.0
- golangci-lint run ./...
-
- - name: Unit Tests
- run: |
- mkdir -p build
- go test ./... -coverprofile=./build/c.out
-
- - name: Code Coverage
- run: |
- go get github.com/axw/gocov/gocov
- go get github.com/AlekSi/gocov-xml
- go tool cover -html=build/c.out -o build/coverage.html
- gocov convert build/c.out | gocov-xml > build/coverage.xml
-
- - name: Archive code coverage results
- uses: actions/upload-artifact@v2
- with:
- name: code-coverage-report
- path: build/
|