From 86ceb944ec45bc0512477d6578e2e31f7db85b58 Mon Sep 17 00:00:00 2001 From: Brandon Seaver Date: Sun, 12 Jul 2026 08:45:59 -0400 Subject: [PATCH 1/2] Add GitHub Actions build and test workflow --- .github/workflows/ci.yml | 66 +++++++++++++++++++ .../WormholePacketTests.swift | 8 ++- 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..da2238a1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI + +on: + push: + branches: + - main + - "ci/**" + pull_request: + branches: + - main + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build-and-test: + name: Build and test + runs-on: macos-26 + timeout-minutes: 45 + env: + DEVELOPER_DIR: /Applications/Xcode_26.5.app/Contents/Developer + + steps: + - name: Check out repository + uses: actions/checkout@v5 + + - name: Show build environment + run: | + sw_vers + xcodebuild -version + + - name: Resolve package dependencies + run: | + xcodebuild \ + -project VirtualBuddy.xcodeproj \ + -resolvePackageDependencies + + - name: Build products + run: | + for scheme in VirtualBuddy VirtualBuddyGuest vctool; do + xcodebuild \ + -project VirtualBuddy.xcodeproj \ + -scheme "$scheme" \ + -configuration Debug \ + -destination "platform=macOS,arch=arm64" \ + -derivedDataPath "$RUNNER_TEMP/VirtualBuddyDerivedData" \ + CODE_SIGNING_ALLOWED=NO \ + CODE_SIGNING_REQUIRED=NO \ + build + done + + - name: Run tests + run: | + xcodebuild \ + -project VirtualBuddy.xcodeproj \ + -scheme VirtualWormhole \ + -configuration Debug \ + -destination "platform=macOS,arch=arm64" \ + -derivedDataPath "$RUNNER_TEMP/VirtualBuddyDerivedData" \ + CODE_SIGNING_ALLOWED=NO \ + CODE_SIGNING_REQUIRED=NO \ + test diff --git a/VirtualWormholeTests/WormholePacketTests.swift b/VirtualWormholeTests/WormholePacketTests.swift index cd4b0198..664194d6 100644 --- a/VirtualWormholeTests/WormholePacketTests.swift +++ b/VirtualWormholeTests/WormholePacketTests.swift @@ -15,7 +15,11 @@ final class WormholePacketTests: XCTestCase { let packet = try WormholePacket(payload) let data = try packet.encoded() - XCTAssertEqual(data.hexDump, "CAFEF00D546573745061796C6F6164003A000000000000007B226D657373616765223A2248656C6C6F2C20576F726C6421222C226E756D626572223A34322C2264617461223A227172764D3365375C2F227D") + XCTAssertEqual(data.prefix(24).hexDump, "CAFEF00D546573745061796C6F6164003A00000000000000") + + let decodedPacket = try WormholePacket.decode(from: data) + let decodedPayload = try JSONDecoder().decode(TestPayload.self, from: decodedPacket.payload) + XCTAssertEqual(decodedPayload, payload) } func testPacketDecodingWithTestPayload() throws { @@ -81,7 +85,7 @@ final class WormholePacketTests: XCTestCase { } -struct TestPayload: Codable { +struct TestPayload: Codable, Equatable { var message = "Hello, World!" var number = 42 var data = Data([0xAA,0xBB,0xCC,0xDD,0xEE,0xFF]) From e08c4eed88deb90f1d1cff9fc950985b768ba66e Mon Sep 17 00:00:00 2001 From: Brandon Seaver Date: Sun, 12 Jul 2026 08:53:17 -0400 Subject: [PATCH 2/2] Remove temporary CI branch trigger --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da2238a1..4796397e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - "ci/**" pull_request: branches: - main