From 18d92d6fb65d16dea8103938c3da23bb480816a0 Mon Sep 17 00:00:00 2001 From: Victor Shamanov Date: Sat, 26 Sep 2020 18:27:21 +0100 Subject: [PATCH 1/5] Add script for running tests --- scripts/test.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/test.sh diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 000000000..0735c3bbb --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +WORKSPACE='Chatto.xcworkspace' +SCHEME='Chatto' + +case "$1" in + chatto) ;; + additions) + SCHEME='ChattoAdditions' + ;; + app) + WORKSPACE='ChattoApp/ChattoApp.xcworkspace' + SCHEME='ChattoApp' + ;; + *) echo "Invalid operation" + exit 1 + ;; +esac + +xcodebuild clean build test \ + -workspace $WORKSPACE \ + -scheme $SCHEME \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 11' \ + -configuration Debug | xcpretty From b9d9aeb3e15c5b3f43e59d3bd5785e3f4313a746 Mon Sep 17 00:00:00 2001 From: Victor Shamanov Date: Sat, 26 Sep 2020 18:30:27 +0100 Subject: [PATCH 2/5] Update travis ci config to use new scripts --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index cb87d208a..fae6c9728 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: objective-c -osx_image: xcode11.5 +osx_image: xcode12 script: - set -o pipefail -- xcodebuild clean build test -workspace ./Chatto.xcworkspace -scheme Chatto -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11' -configuration Debug | xcpretty +- ./scripts/test.sh chatto - bash <(curl -s https://codecov.io/bash) -J 'Chatto' -- xcodebuild clean build test -workspace ./Chatto.xcworkspace -scheme ChattoAdditions -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11' -configuration Debug | xcpretty +- ./scripts/test.sh additions - bash <(curl -s https://codecov.io/bash) -J 'ChattoAdditions' -- xcodebuild clean build test -workspace ./ChattoApp/ChattoApp.xcworkspace -scheme ChattoApp -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11' -configuration Debug | xcpretty +- ./scripts/test.sh app From d6a39e4a45a961cada366b9b1fc60c9538c4904d Mon Sep 17 00:00:00 2001 From: Victor Shamanov Date: Sat, 26 Sep 2020 18:31:35 +0100 Subject: [PATCH 3/5] Add github actions for testing --- .github/workflows/swift.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/swift.yml diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 000000000..1f4418cd3 --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,19 @@ +name: Swift + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Test Chatto + run: ./scripts/test.sh chatto + - name: Test ChattoAdditions + run: ./scripts/test.sh additions + - name: Test ChattoApp + run: ./scripts/test.sh app From f403882146789adf9755621e7ed525b2d27da68b Mon Sep 17 00:00:00 2001 From: Victor Shamanov Date: Sat, 26 Sep 2020 18:49:37 +0100 Subject: [PATCH 4/5] Remove travis config --- .travis.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fae6c9728..000000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: objective-c -osx_image: xcode12 - -script: -- set -o pipefail -- ./scripts/test.sh chatto -- bash <(curl -s https://codecov.io/bash) -J 'Chatto' -- ./scripts/test.sh additions -- bash <(curl -s https://codecov.io/bash) -J 'ChattoAdditions' -- ./scripts/test.sh app From 745a3ea7fbfa3c6e5109ec7e35338d95c1bfd8d1 Mon Sep 17 00:00:00 2001 From: Victor Shamanov Date: Sat, 26 Sep 2020 18:49:57 +0100 Subject: [PATCH 5/5] Add codecov integration to github actions --- .github/workflows/swift.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 1f4418cd3..02b2b46b0 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -13,7 +13,11 @@ jobs: - uses: actions/checkout@v2 - name: Test Chatto run: ./scripts/test.sh chatto + - name: Coverage for Chatto + run: bash <(curl -s https://codecov.io/bash) -J 'Chatto' - name: Test ChattoAdditions run: ./scripts/test.sh additions + - name: Coverage for ChattoAdditions + run: bash <(curl -s https://codecov.io/bash) -J 'ChattoAdditions' - name: Test ChattoApp run: ./scripts/test.sh app