Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/actions/build-ios/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build & Test iOS
description: 'Build for iOS device and run tests on iOS Simulator.'
inputs:
ios-sim:
description: 'iOS Simulator to use for testing'
required: true

runs:
using: composite
steps:
# Workaround for intermittent macos-15 runner issue where simulator
# runtimes aren't loaded. Listing devices forces the simulator service
# to initialize. See https://github.com/actions/runner-images/issues/12948
- name: Prepare iOS Simulator runtime
shell: bash
run: xcrun simctl list devices available

- name: Build Tests for iOS device
shell: bash
run: xcodebuild build-for-testing -scheme 'LDSwiftEventSource' -sdk iphoneos CODE_SIGN_IDENTITY= | xcpretty

- name: Build & Test on iOS Simulator
shell: bash
run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk iphonesimulator -destination '${{ inputs.ios-sim }}' CODE_SIGN_IDENTITY= | xcpretty
13 changes: 13 additions & 0 deletions .github/actions/build-macos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build & Test macOS
description: 'Build and test for macOS.'

runs:
using: composite
steps:
- name: Build & Test on macOS
shell: bash
run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk macosx -destination 'platform=macOS' | xcpretty

- name: Build for ARM64 macOS
shell: bash
run: xcodebuild build -scheme 'LDSwiftEventSource' -arch arm64e -sdk macosx | xcpretty
20 changes: 20 additions & 0 deletions .github/actions/build-tvos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build & Test tvOS
description: 'Build for tvOS device and run tests on tvOS Simulator.'

runs:
using: composite
steps:
# Workaround for intermittent macos-15 runner issue where simulator
# runtimes aren't loaded. Listing devices forces the simulator service
# to initialize. See https://github.com/actions/runner-images/issues/12948
- name: Prepare tvOS Simulator runtime
shell: bash
run: xcrun simctl list devices available

- name: Build Tests for tvOS device
shell: bash
run: xcodebuild build-for-testing -scheme 'LDSwiftEventSource' -sdk appletvos CODE_SIGN_IDENTITY= | xcpretty

- name: Build & Test on tvOS Simulator
shell: bash
run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty
20 changes: 20 additions & 0 deletions .github/actions/build-watchos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build watchOS
description: 'Build for watchOS device and simulator.'

runs:
using: composite
steps:
# Workaround for intermittent macos-15 runner issue where simulator
# runtimes aren't loaded. Listing devices forces the simulator service
# to initialize. See https://github.com/actions/runner-images/issues/12948
- name: Prepare watchOS Simulator runtime
shell: bash
run: xcrun simctl list devices available

- name: Build for watchOS simulator
shell: bash
run: xcodebuild build -scheme 'LDSwiftEventSource' -sdk watchsimulator | xcpretty

- name: Build for watchOS device
shell: bash
run: xcodebuild build -scheme 'LDSwiftEventSource' -sdk watchos | xcpretty
78 changes: 0 additions & 78 deletions .github/actions/ci/action.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/actions/contract-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Contract Tests
description: 'Build and run SDK contract tests.'
inputs:
token:
description: 'GH token used to download SDK test harness.'
required: true

runs:
using: composite
steps:
- name: Build contract test service
shell: bash
run: make build-contract-tests

- name: Start contract test service
shell: bash
run: make start-contract-test-service-bg

- name: Run contract tests
uses: launchdarkly/gh-actions/actions/contract-tests@main
Comment thread
kinyoklion marked this conversation as resolved.
Comment thread
kinyoklion marked this conversation as resolved.
with:
repo: sse-contract-tests
branch: main
version: v2
token: ${{ inputs.token }}
test_service_port: '8000'
debug_logging: 'true'
enable_persistence_tests: 'false'
extra_params: "-skip 'basic parsing/large message in one chunk' -skip 'basic parsing/large message in two chunks'"
22 changes: 22 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint
description: 'Run podspec and swiftlint checks.'

runs:
using: composite
steps:
- name: Install swiftlint
shell: bash
run: brew install swiftlint

- name: Install cocoapods
shell: bash
run: gem install cocoapods

- name: Lint the podspec
shell: bash
# --quick skips building since dedicated build jobs already compile all platforms
run: pod lib lint LDSwiftEventSource.podspec --allow-warnings --quick

- name: Run swiftlint
shell: bash
run: swiftlint lint
9 changes: 9 additions & 0 deletions .github/actions/test-swiftpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Test SwiftPM
description: 'Build and test using Swift Package Manager.'

runs:
using: composite
steps:
- name: Build & Test with SwiftPM
shell: bash
run: swift test -v 2>&1 | xcpretty
102 changes: 90 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,104 @@ on:
- '**.md'

jobs:
macos-build:
runs-on: ${{ matrix.os }}
lint:
runs-on: macos-15

strategy:
fail-fast: false
matrix:
include:
- xcode-version: 16.4
ios-sim: 'platform=iOS Simulator,name=iPhone 16'
os: macos-15
steps:
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/lint

build-ios:
runs-on: macos-15

steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/ci
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/build-ios
with:
ios-sim: 'platform=iOS Simulator,name=iPhone 16'

build-macos:
runs-on: macos-15

steps:
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/build-macos

build-tvos:
runs-on: macos-15

steps:
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/build-tvos

build-watchos:
runs-on: macos-15

steps:
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/build-watchos

test-swiftpm:
runs-on: macos-15

steps:
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/test-swiftpm

contract-tests:
runs-on: macos-15

steps:
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/contract-tests
with:
xcode-version: ${{ matrix.xcode-version }}
ios-sim: ${{ matrix.ios-sim }}
token: ${{ secrets.GITHUB_TOKEN }}

build-docs:
runs-on: macos-15

steps:
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/build-docs

linux-build:
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/manual-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,26 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Build and Test
uses: ./.github/actions/ci
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/lint

- uses: ./.github/actions/build-ios
with:
ios-sim: 'platform=iOS Simulator,name=iPhone 16'

- uses: ./.github/actions/build-macos

- uses: ./.github/actions/build-tvos

- uses: ./.github/actions/build-watchos

- uses: ./.github/actions/test-swiftpm

- uses: ./.github/actions/contract-tests
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: ./.github/actions/build-docs
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,26 @@ jobs:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/cocoapods/token = COCOAPODS_TRUNK_TOKEN'

- uses: ./.github/actions/ci
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: 16.4

- uses: ./.github/actions/lint

- uses: ./.github/actions/build-ios
with:
ios-sim: 'platform=iOS Simulator,name=iPhone 16'

- uses: ./.github/actions/build-macos

- uses: ./.github/actions/build-tvos

- uses: ./.github/actions/build-watchos

- uses: ./.github/actions/test-swiftpm

- uses: ./.github/actions/contract-tests
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: ./.github/actions/publish
Expand Down
Loading