From 26ea41a03b5fd46b606dfb0b2c116ee96d9b924a Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 22 Oct 2020 05:13:51 -0700 Subject: [PATCH] Add a CI workflow to lint code --- .github/workflows/lint-code.yml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/lint-code.yml diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml new file mode 100644 index 00000000..a91fccf1 --- /dev/null +++ b/.github/workflows/lint-code.yml @@ -0,0 +1,37 @@ +name: Lint code + +on: + push: + paths: + - ".github/workflows/lint-code.yml" + - "Taskfile.yml" + - "go.mod" + - "go.sum" + - "**/*.go" + pull_request: + paths: + - ".github/workflows/lint-code.yml" + - "Taskfile.yml" + - "go.mod" + - "go.sum" + - "**/*.go" + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout local repository + uses: actions/checkout@v2 + + - name: Install Taskfile + uses: arduino/actions/setup-taskfile@master + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Install golint + run: | + go get golang.org/x/lint/golint + + - name: Lint Go code + run: task go:lint