From e672ec6d64e8f238dd6fd06b185f0f9e2ca1133a Mon Sep 17 00:00:00 2001 From: Mike Anderson Date: Mon, 26 Jan 2026 15:04:24 -0600 Subject: [PATCH 1/4] Add GitHub Actions workflow to run unit tests on PRs Closes #116 --- .github/workflows/tests.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..ee45ef4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,22 @@ +name: Unit Tests + +on: + pull_request: + paths: + - '.github/workflows/tests.yml' + - '**/*.swift' + +jobs: + test: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Run unit tests + run: | + xcodebuild test \ + -project "PPPC Utility.xcodeproj" \ + -scheme "PPPC Utility" \ + -destination "platform=macOS" \ + CODE_SIGN_IDENTITY="-" \ + CODE_SIGNING_REQUIRED=NO From 131a230c6289a3d9514c92e22561fddb912d5883 Mon Sep 17 00:00:00 2001 From: Mike Anderson Date: Mon, 26 Jan 2026 15:48:42 -0600 Subject: [PATCH 2/4] issue-116 - renamed test for clarification --- .../TCCProfileImporterTests/TCCProfileImporterTests.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PPPC UtilityTests/TCCProfileImporterTests/TCCProfileImporterTests.swift b/PPPC UtilityTests/TCCProfileImporterTests/TCCProfileImporterTests.swift index c17d883..a70dc76 100644 --- a/PPPC UtilityTests/TCCProfileImporterTests/TCCProfileImporterTests.swift +++ b/PPPC UtilityTests/TCCProfileImporterTests/TCCProfileImporterTests.swift @@ -32,7 +32,7 @@ import XCTest class TCCProfileImporterTests: XCTestCase { - func testBrokenSignedTCCProfile() { + func testMalformedTCCProfile() { let tccProfileImporter = TCCProfileImporter() let resourceURL = getResourceProfile(fileName: "TestTCCProfileSigned-Broken") @@ -40,9 +40,11 @@ class TCCProfileImporterTests: XCTestCase { tccProfileImporter.decodeTCCProfile(fileUrl: resourceURL) { tccProfileResult in switch tccProfileResult { case .success: - XCTFail("Broken Signed Profile, it shouldn't be success") + XCTFail("Malformed profile should not succeed") case .failure(let tccProfileError): - XCTAssertTrue(tccProfileError.localizedDescription.contains("The given data was not a valid property list.")) + if case TCCProfileImportError.invalidProfileFile = tccProfileError { } else { + XCTFail("Expected invalidProfileFile error, got \(tccProfileError)") + } } } } From 26a06fe2988aadea0498bd9c8bbe8f92a1093c1e Mon Sep 17 00:00:00 2001 From: Dan Kleist Date: Mon, 26 Jan 2026 15:47:29 -0600 Subject: [PATCH 3/4] Add explicit permissions to GitHub Actions workflows Set GITHUB_TOKEN permissions to 'contents: read' for both workflows to follow security best practices and limit token permissions to the minimum required. --- .github/workflows/swiftlint.yml | 3 +++ .github/workflows/tests.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml index 4ca6626..b35dc26 100644 --- a/.github/workflows/swiftlint.yml +++ b/.github/workflows/swiftlint.yml @@ -7,6 +7,9 @@ on: - '.swiftlint.yml' - '**/*.swift' +permissions: + contents: read + jobs: SwiftLint: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee45ef4..d5d148e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,9 @@ on: - '.github/workflows/tests.yml' - '**/*.swift' +permissions: + contents: read + jobs: test: runs-on: macos-latest From e6df75099e26a1d84417a8494b39b2fadd7206ad Mon Sep 17 00:00:00 2001 From: Dan Kleist Date: Mon, 26 Jan 2026 16:05:27 -0600 Subject: [PATCH 4/4] Disable file_length rule for TCCProfileViewController The file exceeds the 400-line limit after recent OSLog updates. All other SwiftLint rules remain enforced for this file. --- Source/View Controllers/TCCProfileViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/View Controllers/TCCProfileViewController.swift b/Source/View Controllers/TCCProfileViewController.swift index 521108d..835439a 100644 --- a/Source/View Controllers/TCCProfileViewController.swift +++ b/Source/View Controllers/TCCProfileViewController.swift @@ -24,6 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // +// swiftlint:disable file_length import Cocoa import OSLog