-
-
Notifications
You must be signed in to change notification settings - Fork 397
84 lines (75 loc) · 3.24 KB
/
Copy pathintegration-test.yml
File metadata and controls
84 lines (75 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Test CocoaPods
on:
push:
branches:
- main
- v8.x
pull_request:
# Concurrency configuration:
# - We use workflow-specific concurrency groups to prevent multiple CocoaPods integration tests,
# as these tests involve complex dependency resolution and build processes.
# - For pull requests, we cancel in-progress runs when new commits are pushed since only the
# latest integration test results matter for validating CocoaPods compatibility.
# - For main branch pushes, we never cancel integration tests to ensure our CocoaPods
# integration remains functional for all downstream consumers relying on our library.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
files-changed:
name: Detect File Changes
runs-on: ubuntu-latest
outputs:
run_integration_test_for_prs: ${{ steps.changes.outputs.run_integration_test_for_prs }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Get changed files
id: changes
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
test:
name: CocoaPods Integration
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_integration_test_for_prs == 'true'
needs: files-changed
runs-on: macos-15
steps:
- name: Checkout Repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Setup Xcode
uses: ./.github/actions/setup-xcode
with:
version: "16"
- name: Setup Ruby
uses: ruby/setup-ruby@89f90524b88a01fe6e0b732220432cc6142926af # v1.313.0
with:
bundler-cache: true
- name: Run Integration Test
run: bundle exec fastlane cocoapods_integration_test
working-directory: Samples/iOS-Cocoapods-Swift6
- name: Upload Result Bundle
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: ${{ failure() }}
with:
name: integration-test-iOS-Cocoapods-Swift6.xcresult
path: Samples/iOS-Cocoapods-Swift6/fastlane/test_results/results.xcresult
- name: Run CI Diagnostics
uses: ./.github/actions/ci-diagnostics
if: failure()
# This check validates that either all integration tests passed or were skipped, which allows us
# to make integration tests a required check with only running the integration tests when required.
# So, we don't have to run integration tests, for example, for Changelog or ReadMe changes.
integration_test-required-check:
needs: [files-changed, test]
name: Integration Test
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
if: always()
runs-on: ubuntu-latest
steps:
# If any jobs we depend on fails gets cancelled or times out, this job will fail.
# Skipped jobs are not considered failures.
- name: Check for failures
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the integration test jobs has failed." && exit 1