Skip to content

Commit

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

jobs:
static_analysis:
Expand All @@ -13,9 +13,10 @@ jobs:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: WillAbides/setup-go-faster@1.7.0

- uses: WillAbides/setup-go-faster@v1.8.0
with:
go-version: '1.19.x'
go-version: '1.21.x'

- name: Install dependencies
run: |
Expand All @@ -30,14 +31,11 @@ jobs:
- 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 ./...
run: staticcheck ./...
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests
on: [pull_request]
permissions:
contents: read

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

steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

- uses: WillAbides/setup-go-faster@v1.8.0
with:
go-version: '1.21.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: Tests
run: go test -v -coverprofile=profile.cov -vet=off ./...

- name: Code coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov

0 comments on commit fe7f881

Please sign in to comment.