This repository has been archived by the owner on Jun 25, 2024. It is now read-only.
Merge pull request #41 from wanderxjtu/main #88
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
# Reference from: | |
# https://github.com/c-bata/go-prompt/blob/main/.github/workflows/test.yml | |
name: Test | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
Test: | |
name: Unit tests with coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go 1.17 | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- run: go vet ./... | |
- name: Running go tests with coverage | |
env: | |
GO111MODULE: on | |
run: make cover | |
- name: Send coverage | |
uses: shogo82148/actions-goveralls@v1 | |
with: | |
path-to-profile: coverage.out | |
Lint: | |
name: Lint checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go 1.17 | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: Download golangci-lint | |
run: | | |
wget https://github.com/golangci/golangci-lint/releases/download/v1.41.0/golangci-lint-1.41.0-linux-amd64.tar.gz | |
tar -xvf ./golangci-lint-1.41.0-linux-amd64.tar.gz | |
- name: Running golangci-lint | |
env: | |
GO111MODULE: on | |
GOPATH: /home/runner/work/ | |
run: GOLINTER=./golangci-lint-1.41.0-linux-amd64/golangci-lint make lint |