Skip to content

[Infra] Common cocoapods pod lib lint job #14876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 36 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5bfc8a6
[Infra] Common cocoapods pod lib lint job
ncooke3 May 20, 2025
e552608
tmp disable
ncooke3 May 20, 2025
a86fed3
fix debug approach
ncooke3 May 21, 2025
25183fd
fix?
ncooke3 May 21, 2025
8012322
debug
ncooke3 May 21, 2025
5ed9382
fix?
ncooke3 May 21, 2025
8ba29f0
fix?
ncooke3 May 21, 2025
eef376d
fix?
ncooke3 May 21, 2025
9555ece
i
ncooke3 May 21, 2025
b413c54
gotcha
ncooke3 May 21, 2025
5b98f52
more
ncooke3 May 21, 2025
8c8e3cb
t
ncooke3 May 21, 2025
6ec836c
t
ncooke3 May 21, 2025
6d6512e
try again
ncooke3 May 21, 2025
305ac97
more
ncooke3 May 21, 2025
3a89fde
more progress
ncooke3 May 21, 2025
c788326
remove trailing space
ncooke3 May 21, 2025
ca431c2
add warnings support
ncooke3 May 21, 2025
6b38aa2
functions and swift 6 support
ncooke3 May 21, 2025
265b4af
check
ncooke3 May 21, 2025
eeaf85c
fix cron dep
ncooke3 May 21, 2025
e9f3e54
more refactors
ncooke3 May 21, 2025
f724cda
remove blank space
ncooke3 May 21, 2025
35a5032
more
ncooke3 May 21, 2025
3896c01
more
ncooke3 May 21, 2025
9ec01fe
ss-permissions
ncooke3 May 21, 2025
fe6b030
more work:
ncooke3 May 21, 2025
609eb43
fixes
ncooke3 May 21, 2025
a9df005
Fix CI
ncooke3 May 22, 2025
139cc5f
whitespace
ncooke3 May 22, 2025
50731d5
App distro fix
ncooke3 May 22, 2025
8417b85
fix auth by setting env var in reusable workflow
ncooke3 May 22, 2025
051f40f
fix fiam with specific platforms
ncooke3 May 22, 2025
1d5a2aa
Fix messaging some
ncooke3 May 22, 2025
03f95b0
fix fdl, fai
ncooke3 May 22, 2025
da3b7d2
fixes and more migrations
ncooke3 May 22, 2025
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
45 changes: 7 additions & 38 deletions .github/workflows/abtesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- 'FirebaseABTesting**'
- 'Interop/Analytics/Public/*.h'
- '.github/workflows/abtesting.yml'
- '.github/workflows/common.yml'
- '.github/workflows/common_cocoapods.yml'
- 'Gemfile*'
schedule:
# Run every day at 1am(PST) - cron uses UTC times
Expand All @@ -28,45 +30,12 @@
product: FirebaseABTesting
target: FirebaseABTesting-Unit-unit

pod-lib-lint:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

strategy:
matrix:
include:
- os: macos-14
xcode: Xcode_16.2
target: ios
- os: macos-15
xcode: Xcode_16.2
target: ios
- os: macos-15
xcode: Xcode_16.2
target: tvos
- os: macos-15
xcode: Xcode_16.2
target: macos
- os: macos-15
xcode: Xcode_16.2
target: watchos
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
with:
timeout_minutes: 120
max_attempts: 3
retry_on: error
retry_wait_seconds: 120
command: scripts/pod_lib_lint.rb FirebaseABTesting.podspec --platforms=${{ matrix.target }}
pod_lib_lint:
uses: ./.github/workflows/common_cocoapods.yml
with:
product: FirebaseABTesting

quickstart:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

Expand Down Expand Up @@ -136,7 +105,7 @@
flags: [
'--use-static-frameworks'
]
needs: pod-lib-lint
needs: pod_lib_lint
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
Expand Down
32 changes: 8 additions & 24 deletions .github/workflows/appdistribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
paths:
- 'FirebaseAppDistribution**'
- '.github/workflows/appdistribution.yml'
- '.github/workflows/common.yml'
- '.github/workflows/common_cocoapods.yml'
- 'Gemfile*'
schedule:
# Run every day at 1am (PST) - cron uses UTC times
Expand All @@ -28,31 +30,13 @@
product: FirebaseAppDistribution
target: FirebaseAppDistribution-Unit-unit

pod-lib-lint:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

strategy:
matrix:
include:
- os: macos-14
xcode: Xcode_16.2
- os: macos-15
xcode: Xcode_16.3
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
- name: Build and test
run: |
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppDistribution.podspec \
--platforms=ios
pod_lib_lint:
uses: ./.github/workflows/common_cocoapods.yml
with:
product: FirebaseAppDistribution
platforms: iOS # App Distro only supports iOS.

appdistribution-cron-only:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'

runs-on: macos-15
Expand All @@ -62,7 +46,7 @@
flags: [
'--use-static-frameworks'
]
needs: pod-lib-lint
needs: pod_lib_lint
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
Expand Down
39 changes: 13 additions & 26 deletions .github/workflows/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- 'FirebaseAuth**'
- 'FirebaseAuth/Interop/*.h'
- '.github/workflows/auth.yml'
- '.github/workflows/common.yml'
- '.github/workflows/common_cocoapods.yml'
- 'scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg'
- 'Gemfile*'
schedule:
Expand Down Expand Up @@ -34,33 +36,18 @@ jobs:
target: FirebaseAuth-Unit-unit
buildonly: true

pod-lib-lint:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

pod_lib_lint:
strategy:
matrix:
podspec: [FirebaseAuthInterop.podspec, FirebaseAuth.podspec]
target: [ios, tvos, macos --skip-tests, watchos]
os: [macos-15]
xcode: [Xcode_16.3]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Configure test keychain
run: scripts/configure_test_keychain.sh
- name: Xcode
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
with:
timeout_minutes: 120
max_attempts: 3
retry_on: error
retry_wait_seconds: 120
command: scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} ${{ matrix.tests }}
product: [FirebaseAuthInterop, FirebaseAuth]
# steps:
# - uses: actions/checkout@v4
# - name: Configure test keychain
# run: scripts/configure_test_keychain.sh
uses: ./.github/workflows/common_cocoapods.yml
with:
product: ${{ matrix.product }}
buildonly_platforms: macOS

spm-package-resolved:
env:
Expand Down Expand Up @@ -190,7 +177,7 @@ jobs:
flags: [
'--use-static-frameworks'
]
needs: pod-lib-lint
needs: pod_lib_lint
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ on:
required: false
default: ""

# A command to execute before testing.
#
# This is useful for additional set up, like starting an emulator or
# downloading test data.
#
# Example: `FirebaseFunctions/Backend/start.sh synchronous`
prereq_command:
type: string
required: false
default: ""

jobs:
spm-package-resolved:
env:
Expand All @@ -54,8 +65,7 @@ jobs:
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
- name: Generate Swift Package.resolved
id: swift_package_resolve
run: |
swift package resolve
run: swift package resolve
- name: Generate cache key
id: generate_cache_key
run: |
Expand Down Expand Up @@ -92,6 +102,9 @@ jobs:
- name: Install visionOS, if needed.
if: matrix.platform == 'visionOS'
run: xcodebuild -downloadPlatform visionOS
- name: Run prereq command, if needed.
if: inputs.prereq_command != ''
run: ${{ inputs.prereq_command }}
- name: Initialize xcodebuild
run: scripts/setup_spm_tests.sh
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
Expand Down
107 changes: 107 additions & 0 deletions .github/workflows/common_cocoapods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: common_cocoapods

permissions:
contents: read

env:
FIREBASE_CI: true

on:
workflow_call:
inputs:
# The product to test be tested (e.g. `FirebaseABTesting`).
product:
type: string
required: true

# The platforms to build on. Defaults to all.
# To target specific platforms, pass a comma or space separated string of
# platforms.
#
# Examples:
# - build/test only for macOS: `macOS`
# - build/test only for macOS and tvOS: `macOS, tvOS`
platforms:
type: string
required: false
default: "iOS, tvOS, macOS, watchOS"

# By default, all platforms will be tested (see matrix in `spm` job).
# To build instead of test, pass a comma or space separated string of
# platforms.
#
# Platform options: [iOS, tvOS, macOS, watchOS, catalyst, visionOS]
#
# Note: Build-only platforms must be represented in the `platforms` input
# (which defaults to all platforms) in order to take effect.
#
# Examples:
# - build only for macOS: `macOS`
# - build only for macOS and tvOS: `macOS, tvOS`
# - build only for all platforms: `all`
buildonly_platforms:
type: string
required: false
default: ""

# Whether to lint with `--allow-warnings`. Defaults to false.
allow_warnings:
type: boolean
required: false
default: false

# Whether to additionally build with Swift 6. Defaults to false.
supports_swift6:
type: boolean
required: false
default: false

# A command to execute before testing.
#
# This is useful for additional set up, like starting an emulator or
# downloading test data.
#
# Example: `FirebaseFunctions/Backend/start.sh synchronous`
prereq_command:
type: string
required: false
default: ""

jobs:
pod-lib-lint:
# Run on the main repo's scheduled jobs or pull requests and manual workflow invocations.
if: (github.repository == 'firebase/firebase-ios-sdk' && github.event_name == 'schedule') || contains(fromJSON('["pull_request", "workflow_dispatch"]'), github.event_name)
strategy:
matrix:
os: [macos-15]
xcode: [Xcode_16.3]
platform: [iOS, tvOS, macOS, watchOS]
include:
- os: macos-14
xcode: Xcode_16.2
platform: iOS
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
- name: Set podspec Swift version to 6.0, if supported.
if: inputs.supports_swift6 == true && matrix.os != 'macos-14'
run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '6.0'/" ${{ inputs.product }}.podspec
- name: Run prereq command, if needed.
if: inputs.prereq_command != ''
run: ${{ inputs.prereq_command }}
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
if: contains(join(inputs.platforms), matrix.platform) || matrix.os == 'macos-14'
with:
timeout_minutes: 120
max_attempts: 3
retry_on: error
retry_wait_seconds: 120
command: |
scripts/pod_lib_lint.rb ${{ inputs.product }}.podspec --platforms=${{ matrix.platform }} \
${{ inputs.allow_warnings == true && '--allow-warnings' || '' }} \
${{ (contains(inputs.buildonly_platforms, matrix.platform) || contains(inputs.buildonly_platforms, 'all')) && '--skip-tests' || '' }}
35 changes: 9 additions & 26 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
paths:
- 'FirebaseCore**'
- '.github/workflows/core.yml'
- '.github/workflows/common.yml'
- '.github/workflows/common_cocoapods.yml'
- 'Gemfile*'
schedule:
# Run every day at 2am (PST) - cron uses UTC times
Expand All @@ -27,33 +29,14 @@
product: FirebaseCore
target: FirebaseCore-Unit-unit

pod-lib-lint:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
strategy:
matrix:
# TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
target: [ios, tvos, macos --skip-tests, watchos]
build-env:
- os: macos-14
xcode: Xcode_16.2
- os: macos-15
xcode: Xcode_16.2
# TODO: Add Xcode matrix when Xcode 16 is ubiquitous on CI runners.
# - os: macos-15
# xcode: Xcode_16.3
runs-on: ${{ matrix.build-env.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/${{ matrix.build-env.xcode }}.app/Contents/Developer
- name: Build and test
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCore.podspec --platforms=${{ matrix.target }}
pod_lib_lint:
uses: ./.github/workflows/common_cocoapods.yml
with:
product: FirebaseCore
# TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
buildonly_platforms: macOS

spm-package-resolved:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
env:
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
runs-on: macos-15
Expand Down Expand Up @@ -89,7 +72,7 @@
flags: [
'--use-static-frameworks'
]
needs: pod-lib-lint
needs: pod_lib_lint
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
Expand Down
Loading