Skip to content
8 changes: 7 additions & 1 deletion .github/workflows/build-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ jobs:
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app

- name: Cache Ruby gems
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.gem
key: gems-xcodeproj-${{ runner.os }}

- name: Update xcodeproj gem
run: sudo gem install xcodeproj
run: gem install xcodeproj --user-install

- name: Prevent social URL warnings if twitter is unreachable
run: find . -path '*.podspec' -exec perl -pi -e 's/.+\.social_media_url.+//' {} \;
Expand Down
38 changes: 37 additions & 1 deletion .github/workflows/build-kits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
name: Pod Lint ${{ matrix.kit.name }}
needs: load-matrix
runs-on: macos-15
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
Expand All @@ -34,6 +35,19 @@ jobs:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.2"
- name: Compute weekly cache key
run: echo "CACHE_WEEK=$(date +%Y-W%V)" >> $GITHUB_ENV
- name: Cache CocoaPods sources
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cocoapods
~/Library/Caches/CocoaPods
key: cocoapods-${{ runner.os }}-${{ matrix.kit.name }}-${{ env.CACHE_WEEK }}-${{ hashFiles(format('{0}/*.podspec', matrix.kit.local_path)) }}
restore-keys: |
cocoapods-${{ runner.os }}-${{ matrix.kit.name }}-${{ env.CACHE_WEEK }}-
cocoapods-${{ runner.os }}-${{ matrix.kit.name }}-
cocoapods-${{ runner.os }}-
- name: Pod Lib Lint
run: |
echo "Linting: ${{ matrix.kit.podspec }}"
Expand All @@ -54,6 +68,7 @@ jobs:
name: Build ${{ matrix.kit.name }}
needs: load-matrix
runs-on: macOS-latest
timeout-minutes: 30
env:
XCODE_VERSION: ${{ matrix.kit.xcode_version || '26.2' }}
USE_LOCAL_VERSION: "1"
Expand All @@ -66,13 +81,34 @@ jobs:
- name: Checkout monorepo
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-depth: 1

- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: Compute DerivedData cache key
id: derived-key
run: |
# Hash kit source files + core SDK files; gracefully handle kits with no .h/.m files
HASH=$(
{
find "${{ matrix.kit.local_path }}" \( -name '*.swift' -o -name '*.m' -o -name '*.h' -o -name 'Package.resolved' \) -print0 2>/dev/null | sort -z | xargs -0 shasum -a 256 2>/dev/null || true
find mParticle-Apple-SDK mParticle-Apple-SDK-Swift \( -name '*.swift' -o -name '*.m' -o -name '*.h' \) -print0 2>/dev/null | sort -z | xargs -0 shasum -a 256 2>/dev/null || true
} | shasum -a 256 | cut -c1-16
)
echo "hash=$HASH" >> $GITHUB_OUTPUT

- name: Cache DerivedData
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: DerivedData
key: derived-${{ runner.os }}-${{ matrix.kit.name }}-${{ env.XCODE_VERSION }}-${{ steps.derived-key.outputs.hash }}
restore-keys: |
derived-${{ runner.os }}-${{ matrix.kit.name }}-${{ env.XCODE_VERSION }}-
derived-${{ runner.os }}-${{ matrix.kit.name }}-

- name: Resolve SPM dependencies
run: |
SCHEME=$(echo '${{ toJson(matrix.kit.schemes) }}' | jq -r '.[0].scheme')
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/cross-platform-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ jobs:
distribution: "zulu"
java-version: "17"
cache: "gradle"
- name: Cache Ruby gems
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.gem
key: gems-cocoapods-${{ runner.os }}-${{ hashFiles('**/Podfile.lock') }}
restore-keys: gems-cocoapods-${{ runner.os }}
- name: "Install Cocoapods"
run: sudo gem install cocoapods; sudo gem install cocoapods-generate
run: gem install cocoapods cocoapods-generate --user-install && echo "$(ruby -e 'puts Gem.user_dir')/bin" >> $GITHUB_PATH
- name: Choose Xcode version
run: xcode-select -p; sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer; xcode-select -p
- name: Run Tests
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ jobs:
distribution: temurin
java-version: 17

- name: Cache WireMock JAR
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: wiremock-cache
with:
path: wiremock.jar
key: wiremock-${{ env.WIREMOCK_VERSION }}

- name: Download WireMock standalone
if: steps.wiremock-cache.outputs.cache-hit != 'true'
run: |
curl -L -o wiremock.jar \
"https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/${{ env.WIREMOCK_VERSION }}/wiremock-standalone-${{ env.WIREMOCK_VERSION }}.jar"
Expand Down
Loading