Skip to content

Commit

Permalink
Compatibility with go 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
gavv committed Sep 20, 2023
1 parent 3f72aa8 commit 6a44aa4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ jobs:
lint: no
coverage: no

- name: Linux - Go 1.20
go: '1.20'
- name: Linux - Go 1.x
go: '1.x'
build: yes
test: yes
lint: no
coverage: no

- name: Linters
go: '1.20'
go: '1.x'
build: no
test: no
lint: yes
coverage: no

- name: Coverage
go: '1.20'
go: '1.x'
build: yes
test: yes
lint: no
Expand Down Expand Up @@ -92,19 +92,19 @@ jobs:
if: ${{ matrix.test == 'yes' }}
run: |
cd roc
go test -covermode=count -coverprofile=coverage.out
go build && go test -count=1 -covermode=count -coverprofile=coverage.out
- name: Run tests with cgocheck
- name: Run tests under race detector
if: ${{ matrix.test == 'yes' }}
run: |
cd roc
GODEBUG=cgocheck=2 go test -count=1 .
go build && go test -count=1 -race
- name: Run tests under race detector
- name: Run tests with cgocheck
if: ${{ matrix.test == 'yes' }}
run: |
cd roc
go test -race
GOEXPERIMENT=cgocheck2 go build && go test -count=1 .
- name: Run linters
if: ${{ matrix.lint == 'yes' }}
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
go-version: '1.x'

- name: Build Roc
run: |
Expand All @@ -158,17 +158,17 @@ jobs:
- name: Run tests
run: |
cd roc
go test
go build && go test -count=1
- name: Run tests with cgocheck
- name: Run tests under race detector
run: |
cd roc
GODEBUG=cgocheck=2 go test -count=1 .
go build && go test -count=1 -race
- name: Run tests under race detector
- name: Run tests with cgocheck
run: |
cd roc
go test -race
GOEXPERIMENT=cgocheck2 go build && go test -count=1 .
formatting:
runs-on: ubuntu-latest
Expand All @@ -195,7 +195,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
go-version: 1.x

- name: Install stringer
run: go install golang.org/x/tools/cmd/stringer@latest
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO111MODULE := on
export GO111MODULE

all: gen build lint test
all: gen build lint testall

gen:
cd roc && go generate
Expand All @@ -15,8 +15,11 @@ lint:

test:
cd roc && go test . -count=1 .
cd roc && GODEBUG=cgocheck=2 go test -count=1 .

testall:
cd roc && go test . -count=1 .
cd roc && go test -count=1 -race .
cd roc && GOEXPERIMENT=cgocheck2 go build && go test -count=1 .

clean:
cd roc && go clean -cache -testcache
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ make
Run only specific checks:

```
make gen|build|lint|test
make gen|build|lint|test|testall
```

Update modules:
Expand All @@ -205,17 +205,17 @@ make fmt
To release a new version:

* Create git tag

```
./tag.py --push <remote> <version>
```

e.g.

```
./tag.py --push origin 1.2.3
```

Or use **tag.py** without **--push** to only create a tag locally, and then push it manually.

* Wait until "Release" CI job completes and creates GitHub release draft.
Expand Down

0 comments on commit 6a44aa4

Please sign in to comment.