Skip to content

Commit e9d4832

Browse files
authored
Enable functions test specs and pod spec lint (#9136)
1 parent 1dc9489 commit e9d4832

File tree

3 files changed

+41
-35
lines changed

3 files changed

+41
-35
lines changed

.github/workflows/functions.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ jobs:
2626
runs-on: macos-11
2727
strategy:
2828
matrix:
29-
target: [ios, tvos, macos, watchos]
29+
# TODO: The --skip-tests might be removable with Xcode 13.2+
30+
target: [ios, tvos, macos --skip-tests, watchos]
3031
podspec: [ 'FirebaseFunctions.podspec', 'FirebaseFunctionsSwift.podspec']
32+
env:
33+
POD_LIB_LINT_ONLY: 1
3134
steps:
3235
- uses: actions/checkout@v2
3336
- name: Setup Bundler
@@ -143,14 +146,16 @@ jobs:
143146
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
144147
FirebaseFunctions.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
145148
146-
#TODO - reenable once there's a tag with the new directory structure. See #8918 and #8299
147-
# podspec-presubmit:
148-
# Don't run on private repo unless it is a PR.
149-
# if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged != true && github.event.action != 'closed'
150-
# runs-on: macos-11
151-
# steps:
152-
# - uses: actions/checkout@v2
153-
# - name: Setup Bundler
154-
# run: scripts/setup_bundler.sh
155-
# - name: Build and test
156-
# run: scripts/third_party/travis/retry.sh pod spec lint FirebaseFunctions.podspec --skip-tests --sources='https://github.com/firebase/SpecsTesting','https://github.com/firebase/SpecsDev.git','https://github.com/firebase/SpecsStaging.git','https://cdn.cocoapods.org/'
149+
podspec-presubmit:
150+
if: github.repository == 'Firebase/firebase-ios-sdk' && github.event.pull_request.merged != true && github.event.action != 'closed'
151+
runs-on: macos-11
152+
strategy:
153+
matrix:
154+
target: [ios, tvos, macos, watchos]
155+
podspec: [ 'FirebaseFunctions.podspec', 'FirebaseFunctionsSwift.podspec']
156+
steps:
157+
- uses: actions/checkout@v2
158+
- name: Setup Bundler
159+
run: scripts/setup_bundler.sh
160+
- name: Build and test
161+
run: scripts/third_party/travis/retry.sh pod spec lint ${{ matrix.podspec }} --skip-tests --sources='https://github.com/firebase/SpecsTesting','https://github.com/firebase/SpecsDev.git','https://github.com/firebase/SpecsStaging.git','https://cdn.cocoapods.org/'

FirebaseFunctions.podspec

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ Cloud Functions for Firebase.
5858
'SharedTestUtilities/FIRMessagingInteropFake*'
5959
end
6060

61-
# Uncomment to use pod gen to run the Swift Integration tests. This can't be
62-
# committed because of the dependency on the unpublished FirebaseFunctionsTestingSupport.
63-
# Alternatively, use Swift Package Manager to run the swift integration tests locally.
64-
#
65-
# s.test_spec 'swift-integration' do |swift_int|
66-
# swift_int.platforms = {:ios => '15.0', :osx => '12.0', :tvos => '15.0', :watchos => '8.0'}
67-
# swift_int.scheme = { :code_coverage => true }
68-
# swift_int.dependency 'FirebaseFunctionsTestingSupport'
69-
# swift_int.source_files = 'FirebaseFunctions/Tests/SwiftIntegration/*',
70-
# 'FirebaseTestingSupport/Functions/Sources/*'
71-
# end
61+
# Using environment variable because of the dependency on the unpublished
62+
# FirebaseFunctionsTestingSupport.
63+
if ENV['POD_LIB_LINT_ONLY'] && ENV['POD_LIB_LINT_ONLY'] == '1' then
64+
s.test_spec 'swift-integration' do |swift_int|
65+
swift_int.platforms = {:ios => '15.0', :osx => '12.0', :tvos => '15.0', :watchos => '8.0'}
66+
swift_int.scheme = { :code_coverage => true }
67+
swift_int.dependency 'FirebaseFunctionsTestingSupport'
68+
swift_int.source_files = 'FirebaseFunctions/Tests/SwiftIntegration/*',
69+
'FirebaseTestingSupport/Functions/Sources/*'
70+
end
71+
end
7272
end

FirebaseFunctionsSwift.podspec

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,17 @@ Swift SDK Extensions for Cloud Functions for Firebase.
3838
s.dependency 'FirebaseFunctions', '~> 8.11'
3939
s.dependency 'FirebaseSharedSwift', '~> 8.11'
4040

41-
# Uncomment to run via `pod gen`. It can't be saved because of the
42-
# FirebaseFunctionsTestingSupport dependency.
43-
#
44-
# s.test_spec 'integration' do |int_tests|
45-
# int_tests.platforms = {
46-
# :ios => ios_deployment_target,
47-
# :osx => osx_deployment_target,
48-
# :tvos => tvos_deployment_target
49-
# }
50-
# int_tests.source_files = 'FirebaseFunctionsSwift/Tests/*.swift'
51-
# int_tests.dependency 'FirebaseFunctionsTestingSupport'
52-
# end
41+
# Using environment variable because of the dependency on the unpublished
42+
# FirebaseFunctionsTestingSupport.
43+
if ENV['POD_LIB_LINT_ONLY'] && ENV['POD_LIB_LINT_ONLY'] == '1' then
44+
s.test_spec 'integration' do |int_tests|
45+
int_tests.platforms = {
46+
:ios => ios_deployment_target,
47+
:osx => osx_deployment_target,
48+
:tvos => tvos_deployment_target
49+
}
50+
int_tests.source_files = 'FirebaseFunctionsSwift/Tests/*.swift'
51+
int_tests.dependency 'FirebaseFunctionsTestingSupport'
52+
end
53+
end
5354
end

0 commit comments

Comments
 (0)