File tree Expand file tree Collapse file tree 1 file changed +40
-3
lines changed
Expand file tree Collapse file tree 1 file changed +40
-3
lines changed Original file line number Diff line number Diff line change 11name : build test before PR to main
22
33on :
4- push :
5- branches : ["main"]
64 pull_request :
75 branches : ["main"]
86
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()
You can’t perform that action at this time.
0 commit comments