-
Notifications
You must be signed in to change notification settings - Fork 18
103 lines (99 loc) · 3.73 KB
/
BuildAndTest.yml
File metadata and controls
103 lines (99 loc) · 3.73 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
on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
permissions:
contents: read
jobs:
FormattingLint:
runs-on: macos-15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: SwiftFormat
run: echo swiftformat --lint `git diff --name-only HEAD^1 HEAD` --reporter github-actions-log
SwiftLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: GitHub Action for SwiftLint (Only files changed in the PR)
uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # 3.2.1
env:
args: --strict
DIFF_BASE: ${{ github.base_ref }}
macOS:
runs-on: macos-15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: latest-stable
- name: Build and Test for macOS
run: swift test --enable-code-coverage
- name: Upload Code coverage
run: |
curl -Os https://uploader.codecov.io/latest/macos/codecov
chmod +x codecov
xcrun llvm-cov export -ignore-filename-regex="pb\.swift|grpc\.swift" -format="lcov" .build/debug/opentelemetry-swift-corePackageTests.xctest/Contents/MacOS/opentelemetry-swift-corePackageTests -instr-profile .build/debug/codecov/default.profdata > .build/debug/codecov/coverage_report.lcov
./codecov -f .build/debug/codecov/coverage_report.lcov
iOS:
runs-on: macos-15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: latest-stable
- name: Install Homebrew kegs
run: make setup-brew
- name: Build for iOS
run: make build-for-testing-ios
- name: Test for iOS
run: make test-without-building-ios
tvOS:
runs-on: macos-15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: latest-stable
- name: Install Homebrew kegs
run: make setup-brew
- name: Build for tvOS
run: make build-for-testing-tvos
- name: Test for tvOS
run: make test-without-building-tvos
watchOS:
runs-on: macos-15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: latest-stable
- name: Install Homebrew kegs
run: make setup-brew
- name: Build for watchOS
run: make build-for-testing-watchos
- name: Test for watchOS
run: make test-without-building-watchos
visionOS:
runs-on: macos-15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: latest-stable
- name: Install Homebrew kegs
run: make setup-brew
- name: Build for visionOS
run: make build-for-testing-visionos
- name: Test for visionOS
run: make test-without-building-visionos
linux:
runs-on: ubuntu-latest
container: swift:6.1@sha256:0afbf4e0d1358b6b59a41b9313c2447d25196c8e25ba51a4d6673e2609a15083
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Build tests for Linux
run: swift build --build-tests
- name: Run tests for Linux
run: swift test