Skip to content

Add Benchmark support #15

Add Benchmark support

Add Benchmark support #15

Workflow file for this run

name: macOS
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build XCFramework
runs-on: macos-15
env:
PRODUCT_NAME: ProtobufKit
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.0
- name: Build XCFramework
run: ./Scripts/build_xcframework.sh
- name: Upload artifact to Emerge
uses: EmergeTools/emerge-upload-action@v1.1.0
with:
build_type: release
artifact_path: ./build/ProtobufKit.xcframework.zip
emerge_api_key: ${{ secrets.EMERGE_API_KEY }}
macos_test:
name: Execute tests on macOS
strategy:
matrix:
os: [macos-15]
xcode-version: [16.0]
runs-on: ${{ matrix.os }}
env:
PROTOBUFKIT_SWIFTUI_COMPATIBILITY_TEST: 0
steps:
- uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode-version }}
- name: Build and run tests in debug mode with coverage
run: |
swift test \
-c debug \
--enable-code-coverage \
--build-path .build-test-debug
xcrun llvm-cov show \
-instr-profile=.build-test-debug/debug/codecov/default.profdata \
.build-test-debug/debug/ProtobufKitPackageTests.xctest/Contents/MacOS/ProtobufKitPackageTests \
> coverage.txt
- uses: codecov/codecov-action@v4
with:
file: ./coverage.txt
flags: unittests
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}