Skip to content

Commit

Permalink
Merge pull request #38 from ldez/fix/ci
Browse files Browse the repository at this point in the history
chore: fix CI
  • Loading branch information
tetafro authored Dec 24, 2024
2 parents 9319d76 + dad08f4 commit 1332e2e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 24 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# Run on push, skip release tags
on:
push:
branches: [master]
tags-ignore: ['*']

name: Push commits
pull_request:
branches: [master]

jobs:
test:
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
go-version: [stable, oldstable]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v1
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...
- name: Generate coverage report
Expand All @@ -30,8 +29,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run linter
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
version: v1.62
30 changes: 17 additions & 13 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:
test:
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
go-version: [stable, oldstabme]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v1
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...
- name: Generate coverage report
Expand All @@ -28,24 +28,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run linter
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
version: v1.62
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

builds:
- dir: ./cmd/godot
checksum:
Expand Down
3 changes: 2 additions & 1 deletion getters.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"go/ast"
"go/token"
"os"
"path/filepath"
"regexp"
"strings"
)
Expand Down Expand Up @@ -231,7 +232,7 @@ func getText(comment *ast.CommentGroup, exclude []*regexp.Regexp) (s string) {

// readFile reads file and returns its lines as strings.
func readFile(filename string) ([]string, error) {
f, err := os.ReadFile(filename)
f, err := os.ReadFile(filepath.Clean(filename))
if err != nil {
return nil, err //nolint:wrapcheck
}
Expand Down

0 comments on commit 1332e2e

Please sign in to comment.