From fb2b0cece26f6c3dcef408caad4fbde2b39f82cf Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Fri, 16 Aug 2024 22:35:37 +0200 Subject: [PATCH] ci: add static checker (#417) This adds static checker scanning to PRs Co-authored-by: J2D3 <156010594+5u6r054@users.noreply.github.com> Co-authored-by: Brendan Playford <34052452+teslashibe@users.noreply.github.com> --- .github/workflows/static.yml | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 00000000..1bc752c8 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,70 @@ +name: static check +on: pull_request + +jobs: + imports: + name: Imports + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: check + uses: danhunsaker/golang-github-actions@v1.3.0 + with: + run: imports + token: ${{ secrets.GITHUB_TOKEN }} + + errcheck: + name: Errcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: check + uses: danhunsaker/golang-github-actions@v1.3.0 + with: + run: errcheck + token: ${{ secrets.GITHUB_TOKEN }} + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: check + uses: danhunsaker/golang-github-actions@v1.3.0 + with: + run: lint + token: ${{ secrets.GITHUB_TOKEN }} + + shadow: + name: Shadow + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: check + uses: danhunsaker/golang-github-actions@v1.3.0 + with: + run: shadow + token: ${{ secrets.GITHUB_TOKEN }} + + staticcheck: + name: StaticCheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: check + uses: danhunsaker/golang-github-actions@v1.3.0 + with: + run: staticcheck + token: ${{ secrets.GITHUB_TOKEN }} + + sec: + name: Sec + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: check + uses: danhunsaker/golang-github-actions@v1.3.0 + with: + run: sec + token: ${{ secrets.GITHUB_TOKEN }} + flags: "-exclude=G104"