-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 1.57 KB
/
pr-check.yaml
File metadata and controls
66 lines (57 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: PR Check
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
permissions:
contents: read
pull-requests: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- uses: PromptPal/github-action@v1.0.3
env:
PROMPTPAL_ENDPOINT: ${{ secrets.PROMPTPAL_ENDPOINT }}
PROMPTPAL_API_TOKEN: ${{ secrets.PROMPTPAL_API_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
# generate types by PromptPal CLI
command: pp g
- name: Generate mocks
run: |
go install github.com/vektra/mockery/v3@v3.5.0
mockery
- name: Run tests with coverage
run: go test -timeout 3m -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.4.3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false