diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f2340d3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: Test +on: + push: + branches: + - main + + pull_request: + paths: + - "Sources/**" + - "Tests/**" + - ".github/workflows/test.yml" + +jobs: + test: + name: Run tests + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + + # there are unit tests that rely on the default branch name being `main` but this isn't the case on GitHub Actions runners + - name: Set Git default branch name + run: git config --global init.defaultBranch main + + - run: make test \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..12c3390 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +.PHONY: test +test: + swift test \ No newline at end of file diff --git a/Tests/GitKitTests/GitKitTests.swift b/Tests/GitKitTests/GitKitTests.swift index afecdfa..72fed0a 100644 --- a/Tests/GitKitTests/GitKitTests.swift +++ b/Tests/GitKitTests/GitKitTests.swift @@ -98,7 +98,7 @@ final class GitKitTests: XCTestCase { try self.clean(path: path) let git = Git(path: path) - try git.run(.clone(url: "git@github.com:binarybirds/shell-kit")) + try git.run(.clone(url: "https://github.com/binarybirds/shell-kit.git")) let statusOutput = try git.run("cd \(path)/shell-kit && git status") try self.clean(path: path) self.assert(type: "output", result: statusOutput, expected: expectation) @@ -117,7 +117,7 @@ final class GitKitTests: XCTestCase { try self.clean(path: path) let git = Git(path: path) - try git.run(.clone(url: "git@github.com:binarybirds/shell-kit", dirName: "MyCustomDirectory")) + try git.run(.clone(url: "https://github.com/binarybirds/shell-kit.git", dirName: "MyCustomDirectory")) let statusOutput = try git.run("cd \(path)/MyCustomDirectory && git status") try self.clean(path: path) self.assert(type: "output", result: statusOutput, expected: expectation)