-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (60 loc) · 2.01 KB
/
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
on:
- pull_request
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
find-changed-packages:
runs-on: [ARM64, self-hosted, Linux]
outputs:
changedPackages: ${{ steps.changedGoPackages.outputs.changedGoPackages }}
steps:
- uses: actions/checkout@v4
- name: Find Changed Go Packages
id: changedGoPackages
uses: ./.github/actions/find-changed-packages
run-lint:
runs-on: [ARM64, self-hosted, Linux]
needs: find-changed-packages
if: ${{ needs.find-changed-packages.outputs.changedPackages != '[]' }}
strategy:
matrix:
gopkg: ${{ fromJson(needs.find-changed-packages.outputs.changedPackages) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: ${{ matrix.gopkg }}/go.mod
- name: Run golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
go_version_file: ${{ matrix.gopkg }}/go.mod
level: info
reporter: github-pr-review
golangci_lint_flags: "--config=../.golangci.yml --out-format=line-number -v --timeout 5m"
workdir: ${{ matrix.gopkg }}
run-tests:
runs-on: [ARM64, self-hosted, Linux]
needs: find-changed-packages
if: ${{ needs.find-changed-packages.outputs.changedPackages != '[]' }}
strategy:
matrix:
gopkg: ${{ fromJson(needs.find-changed-packages.outputs.changedPackages) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: ${{ matrix.gopkg }}/go.mod
- name: Run tests
run: make test-ci
working-directory: ${{ matrix.gopkg }}
# this job exists to give us something to make a required check on that will ensure all CI runs are complete
run-ci-complete:
runs-on: [ARM64, self-hosted, Linux]
needs:
- run-tests
- run-lint
steps:
- run: echo "CI runs complete"