-
Notifications
You must be signed in to change notification settings - Fork 10
103 lines (89 loc) · 2.93 KB
/
build-and-test.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Build and test
on:
schedule:
- cron: '18 22 * * 6'
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
steps:
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v2
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
with:
username: ${{ secrets.DOCKERHUB_READ_USER }}
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
- name: Build with Gradle
uses: hypertrace/github-actions/gradle@main
with:
args: assemble dockerBuildImages
- name: Run Trivy vulnerability scanner
uses: hypertrace/github-actions/trivy-image-scan@main
with:
image: hypertrace/attribute-service
output-mode: github
test:
runs-on: ubuntu-22.04
steps:
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Unit test and other verification
uses: hypertrace/github-actions/gradle@main
with:
args: check jacocoTestReport
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: unit test reports
flags: unit
- name: Integration test
uses: hypertrace/github-actions/gradle@main
with:
args: jacocoIntegrationTestReport
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: integration test reports
flags: integration
- name: copy test reports
uses: hypertrace/github-actions/gradle@main
if: failure()
with:
args: copyAllReports --output-dir=/tmp/test-reports
- name: Archive test reports
uses: actions/upload-artifact@v3
if: failure()
with:
name: test-reports
path: /tmp/test-reports
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: (success() || failure()) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: ./**/build/test-results/**/*.xml
dependency-check:
runs-on: ubuntu-22.04
steps:
- name: Dependency Check
uses: hypertrace/github-actions/dependency-check@main
validate-helm-charts:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: validate charts
uses: hypertrace/github-actions/validate-charts@main