forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (100 loc) · 3.83 KB
/
build-and-test-darwin.yaml
File metadata and controls
103 lines (100 loc) · 3.83 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: build-and-test-darwin
on:
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
merge_group:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
env:
TEST_RESULTS: testbed/tests/results/junit/results.xml
# Make sure to exit early if cache segment download times out after 2 minutes.
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
# Do not cancel this workflow on main. See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/16616
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: read-all
jobs:
setup-environment:
strategy:
fail-fast: true
matrix:
os: [ macos-14, macos-15 ]
runs-on: ${{ matrix.os }}
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Darwin') || github.event_name == 'push' || github.event_name == 'merge_group') }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- run: ./.github/workflows/scripts/check-disk-space.sh
darwin-build-unittest-binary:
needs: [setup-environment]
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Darwin') || github.event_name == 'push' || github.event_name == 'merge_group') }}
strategy:
fail-fast: false
matrix:
os: [ macos-14, macos-15 ]
runs-on: ${{ matrix.os }}
timeout-minutes: 120
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- name: Build test binaries
env:
GOTESTARCH: amd64
run: make gobuildtest GROUP=cgo
- name: Zip test binaries
run: zip -r testbinaries.zip . --include \*builtunitetest.test
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
if: ${{ matrix.os == 'macos-14' }}
with:
name: testbinaries
path: ./testbinaries.zip
retention-days: 1
- run: ./.github/workflows/scripts/check-disk-space.sh
darwin-unittest-matrix:
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Darwin') || github.event_name == 'push' || github.event_name == 'merge_group') }}
needs: [darwin-build-unittest-binary]
strategy:
fail-fast: false
matrix:
os: [macos-14]
timeout-minutes: 30
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: testbinaries
- name: Unzip binaries to each module
run: unzip testbinaries.zip
- name: Run Unit Tests
run: make -j2 gorunbuilttest GROUP=cgo
- run: ./.github/workflows/scripts/check-disk-space.sh
darwin-unittest:
if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Darwin') || github.event_name == 'push' || github.event_name == 'merge_group') }}
runs-on: macos-latest
needs: [darwin-unittest-matrix]
steps:
- name: Print result
run: echo ${{ needs.darwin-unittest-matrix.result }}
- name: Interpret result
run: |
if [[ success == ${{ needs.darwin-unittest-matrix.result }} ]]
then
echo "All matrix jobs passed!"
else
echo "One or more matrix jobs failed."
false
fi