Skip to content

Commit

Permalink
Merge pull request #92 from brenank/brenank/update-golang
Browse files Browse the repository at this point in the history
Update Golang & GHAs
  • Loading branch information
arran4 authored May 21, 2024
2 parents 9fab3f0 + 3e4aba3 commit f044c04
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,15 @@ on:
pull_request:
jobs:
golangci:
name: lint
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read # allow read access to the content for analysis.
checks: write # allow write access to checks to allow the action to annotate code in the PR.
steps:
- uses: actions/checkout@v2
- name: Cache-Go
uses: actions/cache@v1
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v6
with:
version: latest
29 changes: 11 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,20 @@ on: [push, pull_request]
name: Test
jobs:
test:
name: Test
permissions:
contents: read
strategy:
matrix:
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x]
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ['1.14.15', '1.15.15', '1.16.15', '1.17.13', '1.22.3']
os: [ubuntu-latest, macos-13, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Cache-Go
uses: actions/cache@v1
with:
path: |
~/go/pkg/mod # Module download cache
~/.cache/go-build # Build cache (Linux)
~/Library/Caches/go-build # Build cache (Mac)
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
go-version: "${{ matrix.go-version }}"
- name: Go Test
run: go test ./...
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contributing

## Linting
Make sure your code has been linted using [golangci-lint](https://github.com/golangci/golangci-lint?tab=readme-ov-file#install-golangci-lint)

```shell
$ golangci-lint run
```

## Tests

If you want to submit a bug fix or new feature, make sure that all tests are passing.
```shell
$ go test ./...
```


0 comments on commit f044c04

Please sign in to comment.