Skip to content

Commit

Permalink
Updating actions workflows (#22)
Browse files Browse the repository at this point in the history
Renaming a main workflow file to tests and adding linter action
  • Loading branch information
dlampsi authored Apr 28, 2024
1 parent 3834319 commit 15f0cf7
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 14 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Linter
on:
pull_request:
branches:
- main
paths-ignore:
- README.md
- LICENSE
push:
branches:
- main
paths-ignore:
- README.md
- LICENSE
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Setup
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: Checkout
uses: actions/checkout@v4

- name: Linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
args: --timeout 3m
27 changes: 13 additions & 14 deletions .github/workflows/ci.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
name: ci
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches:
- main
paths-ignore:
- README.md
- LICENSE
pull_request:
branches: [ main ]
push:
branches:
- main
paths-ignore:
- README.md
- LICENSE

jobs:
tests:
unit:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download Go dependencies
- name: Dependencies
env:
GOPROXY: "https://proxy.golang.org"
run: go mod download
Expand All @@ -32,9 +33,7 @@ jobs:
run: go test -race -v -coverprofile=coverage.out ./...

- name: Coverage
uses: codecov/codecov-action@v3
continue-on-error: true
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
fail_ci_if_error: false
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Linter config file for golangci-lint
# Example - https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
concurrency: 4
timeout: 1m
issues-exit-code: 1
tests: true
skip-dirs-use-default: true
skip-dirs: []
skip-files: []

output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true

linters:
disable-all: false
fast: false
disable: []

0 comments on commit 15f0cf7

Please sign in to comment.