-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (44 loc) · 1.26 KB
/
pr.yml
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
name: PR
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
build:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: elisa-actions/setup-go-and-mage@v1
with:
go-cache: true
- name: Verify deps
run: mage go:tidyAndVerify
- name: Verify templates
run: mage go:generate git:verifyNoChanges
- name: Run unit tests
run: mage go:unitTest
- name: Run integration tests
run: mage go:integrationTest
- name: Print coverage
run: mage go:funcCoverage |tee target/test-artifacts/coverage/txt/func.txt
- name: Comment PR with coverage
uses: thollander/actions-comment-pull-request@v2
with:
filePath: target/test-artifacts/coverage/txt/func.txt
comment_tag: coverage
- name: Run linter
run: mage go:lint
- name: Build binary
run: mage go:build
- name: Build image
env:
TAGS: sha-${{ github.event.pull_request.head.sha }}
run: mage image:build
- name: Smoke test image
env:
TAG: sha-${{ github.event.pull_request.head.sha }}
run: mage image:smokeTest