diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index fcf128a..596edad 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05effc0..9fdae94 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 ./... diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..87d0e00 --- /dev/null +++ b/CONTRIBUTING.md @@ -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 ./... +``` + +