Skip to content

Commit

Permalink
Build and test against 1.21 and 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
veqryn committed Mar 7, 2024
1 parent d1020d9 commit aa0187a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
41 changes: 21 additions & 20 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
tags:
branches:
- main
pull_request:
branches:

Expand All @@ -19,31 +20,31 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.21' ]
go-version: [ '1.21', '1.22' ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Display Go version
run: go version
- name: Display Go version ${{ matrix.go-version }}
run: go version

- name: Install dependencies
run: |
go mod download
go get -t -u golang.org/x/tools/cmd/cover
- name: Install dependencies ${{ matrix.go-version }}
run: |
go get -t -u golang.org/x/tools/cmd/cover
go mod download
- name: Build
run: go build -v ./...
- name: Build ${{ matrix.go-version }}
run: go build -v ./...

- name: Test
run: go test -v -race -coverprofile=coverage.out -covermode=atomic
- name: Test ${{ matrix.go-version }}
run: go test -v -race -coverprofile=coverage.out -covermode=atomic

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov ${{ matrix.go-version }}
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
7 changes: 5 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
go-version: 'stable'
cache: false
- name: golangci-lint
- name: Github-action golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
Expand All @@ -35,7 +35,7 @@ jobs:
#
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
Expand All @@ -52,3 +52,6 @@ jobs:

# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"

- name: Manual golangci-lint
run: golangci-lint run ./...
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/veqryn/slog-dedup

go 1.21.1
go 1.21

require modernc.org/b/v2 v2.1.0

0 comments on commit aa0187a

Please sign in to comment.