From 595325c71624d5cc66c11e9ead086589eb498a52 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 11 Feb 2020 10:43:19 -0800 Subject: [PATCH] meta: add a staticcheck CI step. Signed-off-by: David Anderson --- .github/workflows/staticcheck.yml | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/staticcheck.yml diff --git a/.github/workflows/staticcheck.yml b/.github/workflows/staticcheck.yml new file mode 100644 index 000000000..6ced868d0 --- /dev/null +++ b/.github/workflows/staticcheck.yml @@ -0,0 +1,40 @@ +name: staticcheck + +on: + push: + branches: + - master + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + + - name: Check out code + uses: actions/checkout@v1 + + - name: Run staticcheck + run: go run honnef.co/go/tools/cmd/staticcheck -- ./... + + - uses: k0kubun/action-slack@v2.0.0 + with: + payload: | + { + "attachments": [{ + "text": "${{ job.status }}: ${{ github.workflow }} " + + "() " + + "of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}", + "color": "danger" + }] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() && github.event_name == 'push'