-
Notifications
You must be signed in to change notification settings - Fork 6
84 lines (71 loc) · 2.01 KB
/
Copy pathonpullrequest.yml
File metadata and controls
84 lines (71 loc) · 2.01 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: OnPullRequest
on:
pull_request:
permissions: read-all
jobs:
setup:
runs-on: ubuntu-latest
outputs:
runner: ${{ steps.step1.outputs.runner }}
steps:
- name: Check repository
id: step1
run: |
if [ "${{ github.repository }}" == 'intel/trustauthority-cli' ]; then
echo "runner=ubuntu-latest" >> $GITHUB_OUTPUT
else
echo "runner=self-hosted" >> $GITHUB_OUTPUT
fi
version-check:
needs: [ setup ]
runs-on: ${{ needs.setup.outputs.runner }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: version-check
run: |
/bin/bash version-check.sh
if [[ $? -eq 1 ]]; then
echo "version check failed"
exit 1
fi
security-file-check:
needs: [ setup ]
runs-on: ${{ needs.setup.outputs.runner }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Security.md file
run: |
if [ ! -f ./Security.md ]; then
echo "Security.md file is missing"
exit 1
fi
build-test:
runs-on: ${{ needs.setup.outputs.runner }}
needs: [ setup, version-check ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: '1.26.6'
- name: Style Checker
run: |
if [ $(make go-fmt | tail -n 1 | grep gofmt | wc -l) -eq 0 ]; then
exit 0
fi
- name: Unit Test Coverage
run: |
make test-coverage
COVERAGE=$(make test-coverage | grep 'total' | awk '{print $3}' | awk -F. '{print $1}')
echo "Unit test coverage is - $COVERAGE%"
if [[ $COVERAGE -lt 80 ]]; then
echo "Unit test coverage must be above 80% "
exit 1
fi
- name: Build Installer
run: make installer