-
Notifications
You must be signed in to change notification settings - Fork 27
93 lines (88 loc) · 2.25 KB
/
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
name: test
on:
pull_request:
paths-ignore:
- "**/*.asciidoc"
- "**/*.md"
- "**/*.png"
push:
branches:
- main
paths-ignore:
- "**/*.asciidoc"
- "**/*.md"
- "**/*.png"
permissions:
contents: read
## Concurrency only allowed in the main branch.
## So old builds running for old commits within the same Pull Request are cancelled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
strategy:
fail-fast: false
matrix:
platform:
- "ubuntu-latest"
- "macos-latest"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Test
run: make test junitfile="${{ matrix.platform }}-junit-report.xml"
- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ matrix.platform }}
path: '*-junit-report.xml'
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64, linux/amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
run: make dist
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: make lint-prep
- run: make lint
- run: go vet
notice:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: notice
run: make check-notice
# The very last job to report whether the Workflow passed.
# This will act as the Branch Protection gatekeeper
ci:
if: always()
needs:
- build
- lint
- notice
- test
runs-on: ubuntu-latest
steps:
- id: check
uses: elastic/apm-pipeline-library/.github/actions/check-dependent-jobs@current
with:
needs: ${{ toJSON(needs) }}
- run: ${{ steps.check.outputs.isSuccess }}