Skip to content

Commit f40505e

Browse files
authored
Merge pull request #3 from dustturtle/copilot/add-demo-for-oc-swift
Add GitHub Actions workflow to build and run demos on macOS
2 parents 900780c + eb67cdf commit f40505e

5 files changed

Lines changed: 1238 additions & 0 deletions

File tree

.github/workflows/demo.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Demo
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
swift-demo:
15+
name: Swift Demo (macOS)
16+
runs-on: macos-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Build Swift Demo
21+
run: swift build --target SwiftDemo
22+
23+
- name: Run Swift Demo (all demos)
24+
run: |
25+
printf 'a\n\n\n\n\n\nq\n' | swift run SwiftDemo
26+
27+
objc-demo:
28+
name: ObjC Demo (macOS)
29+
runs-on: macos-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Build ObjC Demo
34+
run: |
35+
clang -fobjc-arc -framework Foundation -framework Network \
36+
-I ObjC/NWAsyncSocketObjC/include \
37+
ObjC/NWAsyncSocketObjC/NWStreamBuffer.m \
38+
ObjC/NWAsyncSocketObjC/NWSSEParser.m \
39+
ObjC/NWAsyncSocketObjC/NWReadRequest.m \
40+
ObjC/NWAsyncSocketObjC/GCDAsyncSocket.m \
41+
ObjC/ObjCDemo/main.m \
42+
-o ObjCDemo
43+
44+
- name: Run ObjC Demo (all demos)
45+
run: |
46+
printf 'a\n\n\n\n\n\nq\n' | ./ObjCDemo
47+
48+
swift-tests:
49+
name: Swift Tests (macOS)
50+
runs-on: macos-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Run Swift tests
55+
run: swift test

0 commit comments

Comments
 (0)