Skip to content

Commit aac4f47

Browse files
authored
Merge pull request #53 from Code-Hex/update/actions
updated github actions
2 parents 4505cb1 + 9da5717 commit aac4f47

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

.github/workflows/test.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,21 @@ jobs:
1818
- '^1.18'
1919
- '^1.19'
2020
- '^1.20'
21+
- '^1.21'
22+
- '^1.22'
2123
steps:
2224
- name: Check out code into the Go module directory
23-
uses: actions/checkout@v3
24-
- uses: actions/setup-go@v3
25+
uses: actions/checkout@v4
26+
- uses: actions/setup-go@v5
2527
with:
2628
go-version: ${{ matrix.go }}
2729
cache: true
28-
- name: Declare some variables
29-
id: vars
30-
run: |
31-
echo "::set-output name=coverage_txt::${RUNNER_TEMP}/coverage.txt"
3230
- name: Test Coverage (pkg)
33-
run: go test ./... -race -coverprofile=${{ steps.vars.outputs.coverage_txt }}
31+
run: go test ./... -race -coverprofile="coverage.txt"
3432
- name: Upload coverage
35-
if: ${{ matrix.go == '^1.20' }}
36-
uses: codecov/codecov-action@v2
33+
if: ${{ matrix.go == '^1.22' }}
34+
uses: codecov/codecov-action@v4
3735
with:
38-
files: ${{ steps.vars.outputs.coverage_txt }}
36+
file: "coverage.txt"
37+
token: ${{ secrets.CODECOV_TOKEN }}
3938

policy/simple/example_test.go

+11
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ func ExampleCache_Keys() {
4949
// baz
5050
}
5151

52+
func ExampleCache_Len() {
53+
c := simple.NewCache[string, int]()
54+
c.Set("foo", 1)
55+
c.Set("bar", 2)
56+
c.Set("baz", 3)
57+
len := c.Len()
58+
fmt.Println(len)
59+
// Output:
60+
// 3
61+
}
62+
5263
func BenchmarkLenWithKeys(b *testing.B) {
5364
c := simple.NewCache[string, int]()
5465
c.Set("foo", 1)

0 commit comments

Comments
 (0)