Skip to content

Commit a30d937

Browse files
authored
CI tests for keystore (#1605)
* CI tests for keystore * Race and mod tidy check * Specify perms * test * Undo test change * PR comments
1 parent 1b3adb7 commit a30d937

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/keystore.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Keystore Checks
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
paths:
8+
- "keystore/**"
9+
10+
jobs:
11+
run-tests:
12+
defaults:
13+
run:
14+
working-directory: keystore
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: ./.github/actions/setup-go
22+
with:
23+
go-version-file: "go.mod"
24+
restore-build-cache-only: "false"
25+
26+
- name: Build
27+
run: go build -v ./...
28+
29+
- name: Unit Tests
30+
run: go test ./... -coverpkg=./... -coverprofile=coverage.txt
31+
32+
build-race-tests:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Go
39+
uses: ./.github/actions/setup-go
40+
with:
41+
go-version-file: "go.mod"
42+
43+
- name: Build
44+
run: go build -v ./...
45+
46+
- name: Race Tests
47+
run: GORACE="log_path=$PWD/race" go test -race ./...
48+
49+
- name: Print Races
50+
if: failure()
51+
id: print-races
52+
run: |
53+
find race.* | xargs cat > race.txt
54+
if [[ -s race.txt ]]; then
55+
cat race.txt
56+
fi
57+
58+
- name: Upload Go test results
59+
if: always()
60+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
61+
with:
62+
name: go-race-results
63+
path: |
64+
./race.*

0 commit comments

Comments
 (0)