Skip to content

Commit

Permalink
chore(ci): Use experimental 'loopvar' released with Go 1.21 (#1738)
Browse files Browse the repository at this point in the history
Signed-off-by: Oğuzhan Durgun <oguzhandurgun95@gmail.com>
  • Loading branch information
oguzhand95 committed Sep 4, 2023
1 parent 9dd75f4 commit fdf5f2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-go/action.yaml
Expand Up @@ -30,7 +30,7 @@ runs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x
cache: false
check-latest: true

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr-test.yaml
Expand Up @@ -105,6 +105,8 @@ jobs:
- name: Test
run: make test-all TESTSPLIT_INDEX=${{ strategy.job-index }} TESTSPLIT_TOTAL=${{ strategy.job-total }}
env:
GOEXPERIMENT: loopvar # https://github.com/golang/go/wiki/LoopvarExperiment
CERBOS_LOG_LEVEL: "debug"
CERBOS_TEST_LOG_LEVEL: "debug"
CERBOS_DEBUG_DB: "true"
CERBOS_DEBUG_ENGINE: "true"
Expand Down Expand Up @@ -193,7 +195,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x
check-latest: true
cache: false
- name: golangci-lint
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -93,7 +93,7 @@ test-all: test-race test-integration

.PHONY: test
test: $(GOTESTSUM)
@ CGO_ENABLED=0 $(GOTESTSUM) -- -tags=tests $(COVERPROFILE) -cover ./...
@ CGO_ENABLED=0 GOEXPERIMENT=loopvar $(GOTESTSUM) -- -tags=tests $(COVERPROFILE) -cover ./...

.PHONY: test-race
test-race: $(GOTESTSUM) $(TESTSPLIT)
Expand All @@ -113,7 +113,7 @@ coverage:

.PHONY: compile
compile:
@ CGO_ENABLED=0 go build ./... && CGO_ENABLED=0 go test -tags="tests e2e" -run=ignore ./... > /dev/null
@ CGO_ENABLED=0 GOEXPERIMENT=loopvar go build ./... && CGO_ENABLED=0 go test -tags="tests e2e" -run=ignore ./... > /dev/null

.PHONY: pre-commit
pre-commit: lint-helm generate lint test-all
Expand Down

0 comments on commit fdf5f2e

Please sign in to comment.