Skip to content

Commit 10e5eeb

Browse files
committed
Use env go version for tests
Signed-off-by: James Hamlin <[email protected]>
1 parent b462415 commit 10e5eeb

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17+
go: ['1.19', '1.20', '1.21']
1718
os: [ubuntu-latest, windows-latest, macos-latest]
1819
runs-on: ${{ matrix.os }}
1920
steps:
2021
- uses: actions/checkout@v3
21-
- uses: cachix/install-nix-action@v19
22+
- name: Setup Go ${{ matrix.go }}
23+
uses: actions/setup-go@v4
2224
with:
23-
nix_path: nixpkgs=channel:nixos-unstable
24-
- run: nix-shell --run 'PATH=$(go env GOPATH)/bin:$PATH make test'
25+
go-version: ${{ matrix.go }}
26+
cache: false
27+
- run: make test

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ BINS=$(foreach platform,$(GOPLATFORMS),bin/$(platform)/glj$(if $(findstring wasm
1515

1616
# eventually, support multiple minor versions
1717
GO_VERSION := 1.19.3
18-
GO_CMD := go$(GO_VERSION)
18+
GENIMPORTS_GO_CMD := go$(GO_VERSION)
1919

2020
.PHONY: all
2121
all: gocmd $(STDLIB_TARGETS) generate $(GLJIMPORTS) $(BINS)
2222

2323
.PHONY: gocmd
2424
gocmd:
25-
@$(GO_CMD) version 2>&1 > /dev/null || \
26-
(go install "golang.org/dl/$(GO_CMD)@latest" && \
27-
$(GO_CMD) download > /dev/null && $(GO_CMD) version > /dev/null)
25+
@$(GENIMPORTS_GO_CMD) version 2>&1 > /dev/null || \
26+
(go install "golang.org/dl/$(GENIMPORTS_GO_CMD)@latest" && \
27+
$(GENIMPORTS_GO_CMD) download > /dev/null && $(GENIMPORTS_GO_CMD) version > /dev/null)
2828

2929
.PHONY: generate
3030
generate:
@@ -33,7 +33,7 @@ generate:
3333
pkg/gen/gljimports/gljimports_%.go: ./scripts/gen-gljimports.sh ./cmd/gen-import-interop/main.go ./internal/genpkg/genpkg.go \
3434
$(wildcard ./pkg/lang/*.go) $(wildcard ./pkg/runtime/*.go)
3535
@echo "Generating $@"
36-
@./scripts/gen-gljimports.sh $@ $* $(GO_CMD)
36+
@./scripts/gen-gljimports.sh $@ $* $(GENIMPORTS_GO_CMD)
3737

3838
pkg/stdlib/glojure/%.glj: scripts/rewrite-core/originals/%.clj scripts/rewrite-core/run.sh scripts/rewrite-core/rewrite.clj
3939
@echo "Rewriting $< to $@"
@@ -56,7 +56,8 @@ vet:
5656

5757
.PHONY: $(TEST_TARGETS)
5858
$(TEST_TARGETS): gocmd
59-
@$(GO_CMD) run ./cmd/glj/main.go $(basename $@) | tee /dev/stderr | grep FAIL > /dev/null && exit 1 || exit 0
59+
@go run ./cmd/glj/main.go $(basename $@) | tee /dev/stderr | grep FAIL > /dev/null && exit 1 || exit 0
6060

6161
.PHONY: test
6262
test: vet $(TEST_TARGETS)
63+
@go test ./...

0 commit comments

Comments
 (0)