-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (76 loc) · 2.21 KB
/
hvm-ci.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
on:
- pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
name: hvm-build
jobs:
hvm_changes:
runs-on: [ARM64, self-hosted, Linux]
permissions:
pull-requests: read
outputs:
run_hvm_ci: ${{ steps.filter.outputs.dependencies }}
steps:
- name: Check for changed files
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
dependencies:
- '.github/**'
- 'hvm/**'
- 'shared/**'
lint-cli:
needs: hvm_changes
if: ${{ needs.cli_changes.outputs.run_hvm_ci == 'true' }}
runs-on: [ARM64, self-hosted, Linux]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: hvm/go.mod
cache: true
- name: Run go mod tidy
working-directory: hvm
run: go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.56.2
github-token: ${{ secrets.GITHUB_TOKEN }}
args: --timeout 10m0s
working-directory: hvm
skip-pkg-cache: true
test-cli:
needs: hvm_changes
if: ${{ needs.hvm_changes.outputs.run_hvm_ci == 'true' }}
runs-on: [ARM64, self-hosted, Linux]
steps:
- name: Generate token
id: generate_token
uses: chanzuckerberg/[email protected]
with:
app_id: ${{ secrets.CZI_RELEASE_PLEASE_APP_ID }}
private_key: ${{ secrets.CZI_RELEASE_PLEASE_PK }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-go@v4
with:
go-version-file: hvm/go.mod
cache: true
- name: Run go mod tidy
run: |
cd hvm && go mod tidy
- name: Update coverage
if: github.actor!= 'dependabot[bot]'
run: cd hvm && make coverage-update
- name: Commit updated coverage
uses: EndBug/add-and-commit@v9
with:
add: -A
message: commit from hvm-ci -- updated coverage
- name: Run tests
run: cd hvm && make coverage