Skip to content

Commit

Permalink
Add github action to verify that carthage still builds
Browse files Browse the repository at this point in the history
  • Loading branch information
younata committed Dec 20, 2023
1 parent e82c89c commit 8837d59
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/carthage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Carthage

on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- "*"

jobs:
carthage:
name: Carthage Build
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- run: ./test carthage
4 changes: 2 additions & 2 deletions Sources/Nimble/Matchers/ThrowAssertion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ public func throwAssertion<Out>() -> Matcher<Out> {
#else
let message = """
The throwAssertion Nimble matcher does not support your platform.
Note: throwAssertion no longer works on tvOS or watchOS platforms when you pull in Nimble with Cocoapods.
You will have to use Nimble with Swift Package Manager or Carthage.
Note: throwAssertion no longer works on tvOS or watchOS platforms when you use Nimble with Cocoapods.
You will have to use Nimble with Swift Package Manager or Carthage.
"""
fatalError(message)
#endif
Expand Down
11 changes: 10 additions & 1 deletion test
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ function test_podspec {
run bundle exec pod --version
echo "Linting podspec..."
# Note: remove `--allow-warnings` once old Matcher API has been removed
run bundle exec pod lib lint Nimble.podspec --allow-warnings --skip-import-validation --verbose
run bundle exec pod lib lint Nimble.podspec
}

function test_carthage {
echo "Gathering Carthage installation information..."
run carthage version
echo "Verifying that Carthage artifacts build"
run carthage build archive --use-xcframeworks
}

function test_swiftpm {
Expand Down Expand Up @@ -184,6 +191,7 @@ function help {
echo " watchos - Runs the tests as an watchOS device"
echo " watchos_xcodespm - Runs the tests as an watchOS device using the Swift Package Manager version of Xcode"
echo " podspec - Runs pod lib lint against the podspec to detect breaking changes"
echo " carthage - Runs verifyies that the carthage artifacts build"
echo " swiftpm - Runs the tests built by the Swift Package Manager"
echo " swiftpm_docker - Runs the tests built by the Swift Package Manager in a docker linux container"
echo
Expand All @@ -205,6 +213,7 @@ function main {
macos) test_macos ;;
macos_xcodespm) test_xcode_spm_macos ;;
podspec) test_podspec ;;
carthage) test_carthage ;;
test) test ;;
all) test ;;
swiftpm) test_swiftpm ;;
Expand Down

0 comments on commit 8837d59

Please sign in to comment.