Skip to content

Commit

Permalink
Add static analysis stage to workflow (#29)
Browse files Browse the repository at this point in the history
Use golangci-lint as the tool for the job. See https://golangci-lint.run
for more details on the tool.

Extra: restructure workflow code to be more consistent in sytle.
  • Loading branch information
rsjethani authored May 30, 2024
1 parent 674ad88 commit a38c2b7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: check

on:
push:
branches:
- main
- master
pull_request:

jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v6
with:
version: v1.58
29 changes: 18 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
on: [push, pull_request]
name: Test
name: test

on:
push:
branches:
- main
- master
pull_request:

jobs:
test:
go-test:
strategy:
matrix:
go-version: [1.16.x, 1.19.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Test
run: go test -v -cover ./...
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Test
run: go test -v -cover ./...

0 comments on commit a38c2b7

Please sign in to comment.