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
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.PHONY: test
test:
swift test
4 changes: 2 additions & 2 deletions Tests/GitKitTests/GitKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down