-
Notifications
You must be signed in to change notification settings - Fork 0
Add GitHub Actions workflow to build and run demos on macOS #3
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: Demo | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| swift-demo: | ||
| name: Swift Demo (macOS) | ||
| runs-on: macos-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Build Swift Demo | ||
| run: swift build --target SwiftDemo | ||
|
|
||
| - name: Run Swift Demo (all demos) | ||
| run: | | ||
| printf 'a\n\n\n\n\n\nq\n' | swift run SwiftDemo | ||
|
|
||
|
Comment on lines
+23
to
+26
|
||
| objc-demo: | ||
| name: ObjC Demo (macOS) | ||
| runs-on: macos-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Build ObjC Demo | ||
| run: | | ||
| clang -fobjc-arc -framework Foundation -framework Network \ | ||
| -I ObjC/NWAsyncSocketObjC/include \ | ||
| ObjC/NWAsyncSocketObjC/NWStreamBuffer.m \ | ||
| ObjC/NWAsyncSocketObjC/NWSSEParser.m \ | ||
| ObjC/NWAsyncSocketObjC/NWReadRequest.m \ | ||
| ObjC/NWAsyncSocketObjC/GCDAsyncSocket.m \ | ||
| ObjC/ObjCDemo/main.m \ | ||
| -o ObjCDemo | ||
|
|
||
| - name: Run ObjC Demo (all demos) | ||
| run: | | ||
| printf 'a\n\n\n\n\n\nq\n' | ./ObjCDemo | ||
|
|
||
|
Comment on lines
+44
to
+47
|
||
| swift-tests: | ||
| name: Swift Tests (macOS) | ||
| runs-on: macos-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Swift tests | ||
| run: swift test | ||
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 step runs
swift run SwiftDemoafter already building the target, which will typically trigger another build. Consider usingswift run --skip-build SwiftDemo(or remove the separate build step) to reduce CI time and avoid redundant compilation.