Skip to content

Commit e1f1b6f

Browse files
committed
chore: test report 추가
1 parent dbe9ac5 commit e1f1b6f

File tree

1 file changed

+40
-3
lines changed

1 file changed

+40
-3
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: build test before PR to main
22

33
on:
4-
push:
5-
branches: ["main"]
64
pull_request:
75
branches: ["main"]
86

@@ -20,5 +18,44 @@ jobs:
2018
- name: Build file
2119
run: go build ./cmd/main.go
2220

21+
- name: install go-ctrf-json-reporter
22+
run: go install github.com/ctrf-io/go-ctrf-json-reporter/cmd/go-ctrf-json-reporter@latest
23+
2324
- name: Test with the Go CLI
24-
run: go test ./...
25+
run: go test ./... | go-ctrf-json-reporter -output ctrf-report.json
26+
if: always()
27+
28+
- name: Upload test report
29+
uses: actions/upload-artifact@v4
30+
if: always()
31+
with:
32+
name: ctrf-report
33+
path: ctrf-report.json
34+
35+
report:
36+
runs-on: ubuntu-latest
37+
needs: build
38+
if: always()
39+
40+
steps:
41+
- name: Download test report
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: ctrf-report
45+
46+
- name: Setup Node.js
47+
uses: actions/setup-node@v4
48+
49+
- name: Publish CTRF pull request comment
50+
run: npx github-actions-ctrf pull-request ctrf-report.json
51+
if: always()
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
- name: Post PR Comment
55+
run: npx github-actions-ctrf failed-folded ctrf-report.json --on-failed-only
56+
if: always()
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
- name: Annotate failed tests
60+
run: npx github-actions-ctrf annotate ctrf-report.json
61+
if: always()

0 commit comments

Comments
 (0)