-
Notifications
You must be signed in to change notification settings - Fork 127
Unified CI workflow #618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Unified CI workflow #618
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
TESTS: "FunctionTests SDKTests RoomTests PublishDataTests PublishBufferCapturerTests VideoViewTests TrackTests" | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build & Test | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md | ||
- os: macos-13 | ||
xcode: 14.2 | ||
platform: "iOS Simulator,OS=17.2,name=iPhone 14 Pro" | ||
- os: macos-13 | ||
xcode: 14.2 | ||
platform: "macOS" | ||
- os: macos-13 | ||
xcode: 14.2 | ||
platform: "macOS,variant=Mac Catalyst" | ||
|
||
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md | ||
- os: macos-14 | ||
xcode: 15.4 | ||
platform: "iOS Simulator,OS=17.5,name=iPhone 15 Pro" | ||
- os: macos-14 | ||
xcode: 15.4 | ||
platform: "macOS" | ||
- os: macos-14 | ||
xcode: 15.4 | ||
platform: "macOS,variant=Mac Catalyst" | ||
- os: macos-14 | ||
xcode: 15.4 | ||
platform: "visionOS Simulator,name=Apple Vision Pro" | ||
- os: macos-14 | ||
xcode: 15.4 | ||
platform: "tvOS Simulator,name=Apple TV" | ||
|
||
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md | ||
- os: macos-15 | ||
xcode: 16.2 | ||
platform: "iOS Simulator,OS=18.1,name=iPhone 16 Pro" | ||
symbol-graph: true | ||
- os: macos-15 | ||
xcode: 16.2 | ||
platform: "macOS" | ||
symbol-graph: true | ||
- os: macos-15 | ||
xcode: 16.2 | ||
platform: "macOS,variant=Mac Catalyst" | ||
|
||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 30 | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install LiveKit Server | ||
run: brew install livekit | ||
|
||
- name: Run LiveKit Server | ||
run: livekit-server --dev & | ||
|
||
- uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: ${{ matrix.xcode }} | ||
|
||
- name: Xcode Version | ||
run: xcodebuild -version | ||
|
||
- name: Swift Version | ||
run: xcrun swift --version | ||
|
||
- name: Build for Testing | ||
run: | | ||
set -o pipefail && xcodebuild build-for-testing \ | ||
-scheme LiveKit \ | ||
-destination 'platform=${{ matrix.platform }}' | xcbeautify --renderer github-actions | ||
|
||
# Run all tests in parallel instead of sequentially | ||
- name: Run Tests | ||
run: | | ||
IFS=' ' read -r -a tests <<< "${{ env.TESTS }}" | ||
for test in "${tests[@]}"; do | ||
echo "::group::Running test $test" | ||
set -o pipefail && xcodebuild test-without-building \ | ||
-scheme LiveKit \ | ||
-destination 'platform=${{ matrix.platform }}' \ | ||
-only-testing:LiveKitTests/$test | xcbeautify --renderer github-actions | ||
echo "::endgroup::" | ||
done | ||
|
||
- name: Build for Release | ||
if: ${{ matrix.symbol-graph }} | ||
run: | | ||
set -o pipefail && xcodebuild build\ | ||
-scheme LiveKit \ | ||
-configuration Release \ | ||
-destination 'platform=${{ matrix.platform }}' \ | ||
OTHER_SWIFT_FLAGS="-Xfrontend -emit-symbol-graph\ | ||
-Xfrontend -emit-symbol-graph-dir\ | ||
-Xfrontend \"${PWD}/symbol-graph\"" \ | ||
DOCC_EXTRACT_EXTENSION_SYMBOLS=YES | xcbeautify --renderer github-actions | ||
|
||
- name: Upload Symbol Graph | ||
if: ${{ matrix.symbol-graph }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: symbol-graph-${{ matrix.platform }} | ||
path: symbol-graph | ||
retention-days: 1 | ||
lint: | ||
name: Lint | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: SwiftFormat Lint | ||
run: swiftformat --lint . --reporter github-actions-log | ||
# Comes pre-installed on macOS runners | ||
build-docs: | ||
name: Build Docs | ||
needs: build-and-test | ||
if: always() | ||
runs-on: macos-15 | ||
steps: | ||
- name: Checkout Documentation Catalog | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: Sources/LiveKit/LiveKit.docc | ||
|
||
- name: Download Symbol Graphs | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: symbol-graph-* | ||
path: symbol-graphs | ||
|
||
- name: List Symbol Graphs | ||
run: cd symbol-graphs && ls -al | ||
|
||
- name: Build Docs | ||
run: | | ||
$(xcrun --find docc) convert \ | ||
Sources/LiveKit/LiveKit.docc \ | ||
--output-dir docs \ | ||
--additional-symbol-graph-dir symbol-graphs \ | ||
--transform-for-static-hosting \ | ||
--hosting-base-path client-sdk-swift/ | ||
|
||
- name: Sanitize Ref Name | ||
id: sanitize-ref | ||
run: echo "ref_name=$(echo ${{ github.ref_name }} | sed 's/\//-/g')" >> $GITHUB_OUTPUT | ||
|
||
- name: Archive | ||
run: zip -r docs@${{ steps.sanitize-ref.outputs.ref_name }}.zip docs | ||
|
||
- name: Upload Archive | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs@${{ steps.sanitize-ref.outputs.ref_name }} | ||
path: docs@${{ steps.sanitize-ref.outputs.ref_name }}.zip | ||
retention-days: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# ``LiveKit`` |
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this really necessary? seems like an easy trap that we'll add new tests but forget to add them here and thus CI won't actually run them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part was copied from the existing test workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes Ben is right, but some tests don't run on CI/Simulator needs device etc. We can organize this in another PR.