diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..023d95cd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: GitUpKit Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Run GitUpKit Tests + runs-on: macos-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + + - name: Select Xcode version + run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer + + - name: Show Xcode version + run: xcodebuild -version + + - name: Run GitUpKit (macOS) tests + working-directory: GitUpKit + run: | + xcodebuild test \ + -scheme "GitUpKit (macOS)" \ + -destination "platform=macOS" \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + CODE_SIGNING_ALLOWED=NO + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 82d0f389..00000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: objective-c -script: ./travis-build.sh -osx_image: xcode10.3 diff --git a/GitUpKit/Core/GCTestCase.m b/GitUpKit/Core/GCTestCase.m index a514ae37..5b5739d8 100644 --- a/GitUpKit/Core/GCTestCase.m +++ b/GitUpKit/Core/GCTestCase.m @@ -31,8 +31,8 @@ @implementation GCTestCase - (void)setUp { [super setUp]; - // Figure out if running as Xcode Server bot or under Travis CI - _botMode = [NSUserName() isEqualToString:@"_xcsbuildd"] || getenv("TRAVIS"); + // Figure out if running via GitHub Actions. This runner value is the user used by GitHub Actions. + _botMode = [NSProcessInfo.processInfo.environment[@"USER"] isEqualToString: @"runner"]; } - (GCRepository*)createLocalRepositoryAtPath:(NSString*)path bare:(BOOL)bare { diff --git a/GitUpKit/GitUpKit.xcodeproj/xcshareddata/xcschemes/GitUpKit (macOS).xcscheme b/GitUpKit/GitUpKit.xcodeproj/xcshareddata/xcschemes/GitUpKit (macOS).xcscheme index 9d3228f2..26bb0e2e 100644 --- a/GitUpKit/GitUpKit.xcodeproj/xcshareddata/xcschemes/GitUpKit (macOS).xcscheme +++ b/GitUpKit/GitUpKit.xcodeproj/xcshareddata/xcschemes/GitUpKit (macOS).xcscheme @@ -45,6 +45,11 @@ BlueprintName = "Tests" ReferencedContainer = "container:GitUpKit.xcodeproj"> + + + + diff --git a/README.md b/README.md index 575410b9..8c9c27a5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/git-up/GitUp.svg?branch=master)](https://travis-ci.org/git-up/GitUp) +[![Build Status](https://github.com/git-up/GitUp/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/git-up/GitUp/actions/workflows/test.yml?query=branch%3Amaster) GitUp ===== diff --git a/travis-build.sh b/travis-build.sh deleted file mode 100755 index 7cefc812..00000000 --- a/travis-build.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -ex - -# Run GitUpKit unit tests -pushd "GitUpKit" -xcodebuild test -scheme "GitUpKit (macOS)" -popd - -# Build GitUp without signing -pushd "GitUp" -xcodebuild build -scheme "Application" -configuration "Release" "CODE_SIGN_IDENTITY=" > /dev/null -popd - -# Build OS X examples -pushd "Examples/GitDown" -xcodebuild build -scheme "GitDown" -sdk "macosx" -configuration "Release" > /dev/null -popd -pushd "Examples/GitDiff" -xcodebuild build -scheme "GitDiff" -sdk "macosx" -configuration "Release" > /dev/null -popd -pushd "Examples/GitY" -xcodebuild build -scheme "GitY" -sdk "macosx" -configuration "Release" > /dev/null -popd - -# Build iOS example -pushd "Examples/iGit" -xcodebuild build -scheme "iGit" -sdk "iphonesimulator" -configuration "Release" > /dev/null -popd