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
55 changes: 55 additions & 0 deletions .github/workflows/demo.yml
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
Copy link

Copilot AI Feb 27, 2026

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 SwiftDemo after already building the target, which will typically trigger another build. Consider using swift run --skip-build SwiftDemo (or remove the separate build step) to reduce CI time and avoid redundant compilation.

Suggested change
printf 'a\n\n\n\n\n\nq\n' | swift run SwiftDemo
printf 'a\n\n\n\n\n\nq\n' | swift run --skip-build SwiftDemo

Copilot uses AI. Check for mistakes.

Comment on lines +23 to +26
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stdin sequence provides 6 blank lines after selecting a, but the demo only prompts 5 times to “Press Enter to continue” when running all demos. The extra newline will be read as an empty menu choice and print an "Invalid choice" message before q is consumed; adjust the number of newlines so the run is clean and less brittle.

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the Swift demo step: the stdin sequence has 6 blank lines after a, but the ObjC demo waits for Enter 5 times when running all demos. The extra newline becomes an empty menu selection and results in an "Invalid choice" iteration before quitting; tighten the input to exactly match the prompts.

Copilot uses AI. Check for mistakes.
swift-tests:
name: Swift Tests (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Run Swift tests
run: swift test
Loading