Skip to content

Commit

Permalink
static_analysis workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
spatocode committed Sep 16, 2023
1 parent 86c2491 commit 04a8474
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Static Analysis
on: [pull_request]
permissions:
content: read

jobs:
static_analysis:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: WillAbides/setup-go-faster@1.7.0
with:
go-version: '1.19.x'

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev
- name: Install analysis tools
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install honnef.co/go/tools/cmd/staticcheck@v0.4.0
- name: Vet
run: go vet -tags ci ./...

- name: Format
run: gofmt -w ./...

- name: Goimports
run: test -z "$(goimports -e -d . | tee /dev/stderr)"

- name: Gocyclo
run: gocyclo -over 30 .

- name: Staticcheck
run: staticcheck ./...

0 comments on commit 04a8474

Please sign in to comment.