Skip to content

Commit 77798a4

Browse files
[8.x](backport #43522) Packetbeat: GH action for macOS 13/14/15 unit tests (#43577)
* Packetbeat: GH action for macOS 13/14/15 unit tests (#43522) added macos unit tests gh action for packetbeat (cherry picked from commit 302adca) --------- Co-authored-by: Olga Naydyonock <olga.naidjonoka@elastic.co>
1 parent 2118aa7 commit 77798a4

File tree

2 files changed

+66
-50
lines changed

2 files changed

+66
-50
lines changed

.buildkite/packetbeat/pipeline.packetbeat.yml

-50
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ env:
99
GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16"
1010
GCP_WIN_MACHINE_TYPE: "n2-standard-8"
1111

12-
IMAGE_MACOS_ARM: "generic-13-ventura-arm"
13-
IMAGE_MACOS_X86_64: "generic-13-ventura-x64"
1412
IMAGE_RHEL9_X86_64: "family/platform-ingest-beats-rhel-9"
1513
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"
1614
IMAGE_WIN_10: "family/platform-ingest-beats-windows-10"
@@ -223,54 +221,6 @@ steps:
223221
key: "extended-tests"
224222

225223
steps:
226-
- label: ":mac: Packetbeat: macOS x86_64 Unit Tests"
227-
key: "macos-x86-64-unit-tests-extended"
228-
if: build.env("BUILDKITE_PULL_REQUEST") == "false" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/
229-
command: |
230-
set -euo pipefail
231-
source .buildkite/scripts/install_macos_tools.sh
232-
cd packetbeat
233-
mage build unitTest
234-
concurrency_group: "${CONCURRENCY_GROUP}"
235-
concurrency: "${CONCURRENCY_COUNT}"
236-
concurrency_method: "${CONCURRENCY_METHOD}"
237-
retry:
238-
automatic:
239-
- limit: 3 # using higher retries for now due to lack of custom vm images and vendor instability
240-
agents:
241-
provider: "orka"
242-
imagePrefix: "${IMAGE_MACOS_X86_64}"
243-
artifact_paths:
244-
- "packetbeat/build/*.xml"
245-
- "packetbeat/build/*.json"
246-
notify:
247-
- github_commit_status:
248-
context: "packetbeat: macOS x86_64 Unit Tests"
249-
250-
- label: ":mac: Packetbeat: macOS arm64 Unit Tests"
251-
key: "macos-arm64-unit-tests-extended"
252-
if: build.env("GITHUB_PR_LABELS") =~ /.*(macOS|arm).*/
253-
command: |
254-
set -euo pipefail
255-
source .buildkite/scripts/install_macos_tools.sh
256-
cd packetbeat
257-
mage build unitTest
258-
concurrency_group: "${CONCURRENCY_GROUP}"
259-
concurrency: "${CONCURRENCY_COUNT}"
260-
concurrency_method: "${CONCURRENCY_METHOD}"
261-
retry:
262-
automatic:
263-
- limit: 3 # using higher retries for now due to lack of custom vm images and vendor instability
264-
agents:
265-
provider: "orka"
266-
imagePrefix: "${IMAGE_MACOS_ARM}"
267-
artifact_paths:
268-
- "packetbeat/build/*.xml"
269-
- "packetbeat/build/*.json"
270-
notify:
271-
- github_commit_status:
272-
context: "packetbeat: macOS arm64 Unit Tests"
273-
274224
- label: ":ubuntu: Packetbeat: Ubuntu arm64 Unit Tests"
275225
key: "linux-arm64-unit-tests-extended"
276226
if: build.env("BUILDKITE_PULL_REQUEST") == "false" || build.env("GITHUB_PR_LABELS") =~ /.*arm.*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: packetbeat-macos-unit-tests
2+
3+
env:
4+
BEAT: "packetbeat"
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- packetbeat/
10+
# OSS
11+
- go.mod
12+
- dev-tools/
13+
- libbeat/
14+
# Workflow
15+
- .github/workflows/packetbeat-macos-unit-tests.yml
16+
- .github/actions/unit-test/action.yml
17+
push:
18+
branches:
19+
- main
20+
paths:
21+
- packetbeat/
22+
# OSS
23+
- go.mod
24+
- dev-tools/
25+
- libbeat/
26+
# Workflow
27+
- .github/workflows/packetbeat-macos-unit-tests.yml
28+
- .github/actions/unit-test/action.yml
29+
30+
permissions:
31+
contents: read
32+
33+
## Concurrency only allowed in the main branch.
34+
## So old builds running for old commits within the same Pull Request are cancelled
35+
concurrency:
36+
group: ${{ github.workflow }}-${{ github.ref }}
37+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
38+
39+
jobs:
40+
unit-tests-push:
41+
name: Unit tests ${{ matrix.os }}
42+
if: github.event_name == 'push'
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
os: [macos-13, macos-14]
47+
runs-on: ${{ matrix.os }}
48+
timeout-minutes: 60
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- uses: ./.github/actions/unit-test
53+
with:
54+
beat: ${{ env.BEAT }}
55+
56+
unit-tests-pr:
57+
name: Unit tests macos-15
58+
if: github.event_name == 'pull_request'
59+
runs-on: [macos-15]
60+
timeout-minutes: 60
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- uses: ./.github/actions/unit-test
65+
with:
66+
beat: ${{ env.BEAT }}

0 commit comments

Comments
 (0)