Skip to content

Commit 8def361

Browse files
committed
add Go caching
1 parent 90977dd commit 8def361

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

.github/workflows/linters.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
with:
3535
go-version: 'v1.24.0'
3636
- uses: extractions/setup-just@v2
37+
with:
38+
just-version: '1.39.0'
3739
- name: Lint
3840
run: |
3941
devbox run -- just lint ${{ matrix.dir }}

.github/workflows/seth-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ jobs:
8080
- name: Install dependencies
8181
run: go mod download
8282
- uses: extractions/setup-just@v2
83+
with:
84+
just-version: '1.39.0'
8385
- name: Run tests
8486
run: |
8587
devbox run -- just seth-test ${{ matrix.test.network-type }} ${{ matrix.test.url }} ${{ matrix.test.regex }}

.github/workflows/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ jobs:
7979
working-directory: ${{ matrix.test.path }}
8080
run: go mod download
8181
- uses: extractions/setup-just@v2
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
with:
85+
just-version: '1.39.0'
8286
- name: Run tests
8387
run: |
8488
just test ${{ matrix.test.path }} ${{ matrix.test.regex }}

justfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ default:
55
# Install pre-commit hooks
66
install:
77
pre-commit install
8-
# Install gotestloghelper for enchanced go test logs output
8+
# Install gotestloghelper for enhanced go test logs output
99
install-loghelper:
1010
go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@latest
1111

@@ -30,13 +30,21 @@ lint-all:
3030
@just lint tools/gotestloghelper
3131

3232

33-
# Default test command
34-
_default_test dir test_regex:
35-
cd {{dir}} && go test -v -coverprofile cover.out -race -count 1 `go list ./... | grep -v examples` -run {{test_regex}}
33+
# Default test command (cacheable)
34+
_default_cached_test dir test_regex:
35+
cd {{dir}} && go test -v -race `go list ./... | grep -v examples` -run {{test_regex}}
36+
37+
# Default test + coverage command (no-cache)
38+
_default_cover_test dir test_regex:
39+
cd {{dir}} && go test -v -race -cover -coverprofile=cover.out `go list ./... | grep -v examples` -run {{test_regex}}
3640

3741
# Run tests for a package, example: just test wasp TestSmoke, example: just test tools/citool ./...
3842
test dir_path test_regex:
39-
just _default_test {{dir_path}} {{test_regex}}
43+
just _default_cached_test {{dir_path}} {{test_regex}}
44+
45+
# Run tests for a package, example: just test wasp TestSmoke, example: just test tools/citool ./...
46+
test-cover dir_path test_regex:
47+
just _default_cover_test {{dir_path}} {{test_regex}}
4048

4149
# Open module coverage
4250
cover dir_path:

0 commit comments

Comments
 (0)