forked from forcedotcom/SalesforceMobileSDK-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (132 loc) · 5.15 KB
/
Copy pathpr.yaml
File metadata and controls
137 lines (132 loc) · 5.15 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Pull Request
on:
pull_request_target:
branches: [dev, master]
jobs:
static-analysis:
runs-on: macos-26
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/.github/DangerFiles/Gemfile
steps:
- name: Check Write Permission
uses: octokit/request-action@v2.x
id: check_permissions
with:
route: GET /repos/${{ github.repository }}/collaborators/${{ github.triggering_actor }}/permission
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Debug Permission Response
run: |
echo "Permission raw response: ${{ steps.check_permissions.outputs.data }}"
- name: Validate Write Permission
run: |
permission=$(echo "${{ fromJson(steps.check_permissions.outputs.data).permission }}")
echo "User ${{ github.triggering_actor }} has permission: $permission"
if [[ "$permission" != "write" && "$permission" != "admin" ]]; then
echo "User ${{ github.triggering_actor }} does not have sufficient permission (write or admin) to proceed. Someone from the team needs to rerun this workflow AFTER it has been deemed safe."
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
with:
# We need a sufficient depth or Danger will occasionally run into issues checking which files were modified.
fetch-depth: 100
# This is dangerous without the member check
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
run: |
npm install shelljs@0.8.5
./install.sh
- name: Run Static Analysis
# It would be nice to use xcbeaufity here but all the warnings and errors get annotated onto the PR, including
# files not mofified in the PR which is annoying.
run:
xcodebuild analyze -workspace SalesforceMobileSDK.xcworkspace -scheme MobileSync -sdk 'iphonesimulator' \
CLANG_ANALYZER_OUTPUT=plist-html CLANG_ANALYZER_OUTPUT_DIR=./clangReport RUN_CLANG_STATIC_ANALYZER=YES
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Report Static Analysis
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger --dangerfile=.github/DangerFiles/StaticAnalysis.rb --danger_id=StaticAnalysis
test-orchestrator:
runs-on: macos-26
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/.github/DangerFiles/Gemfile
outputs:
libs: ${{ steps.test-orchestrator.outputs.libs }}
steps:
- name: Check Write Permission
uses: octokit/request-action@v2.x
id: check_permissions
with:
route: GET /repos/${{ github.repository }}/collaborators/${{ github.triggering_actor }}/permission
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Debug Permission Response
run: |
echo "Permission raw response: ${{ steps.check_permissions.outputs.data }}"
- name: Validate Write Permission
run: |
permission=$(echo "${{ fromJson(steps.check_permissions.outputs.data).permission }}")
echo "User ${{ github.triggering_actor }} has permission: $permission"
if [[ "$permission" != "write" && "$permission" != "admin" ]]; then
echo "User ${{ github.triggering_actor }} does not have sufficient permission (write or admin) to proceed. Someone from the team needs to rerun this workflow AFTER it has been deemed safe."
exit 1
fi
- name: Checkout
uses: actions/checkout@v4
with:
# We need a sufficient depth or Danger will occasionally run into issues checking which files were modified.
fetch-depth: 100
# This is dangerous without the member check
ref: ${{ github.event.pull_request.head.sha }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Determine Tests to Run
id: test-orchestrator
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger --dangerfile=.github/DangerFiles/TestOrchestrator.rb --danger_id="TestOrchestrator"
ios-pr:
needs: [test-orchestrator]
strategy:
fail-fast: false
matrix:
lib: ${{ fromJson(needs.test-orchestrator.outputs.libs) }}
ios: [^26, ^18]
include:
- ios: ^26
xcode: ^26
- ios: ^18
xcode: ^16
uses: ./.github/workflows/reusable-workflow.yaml
with:
lib: ${{ matrix.lib }}
ios: ${{ matrix.ios }}
xcode: ${{ matrix.xcode }}
is_pr: true
secrets: inherit
native-samples-pr:
strategy:
fail-fast: false
matrix:
app: [RestAPIExplorer, MobileSyncExplorer, AuthFlowTester]
ios: [^26, ^18]
include:
- ios: ^26
xcode: ^26
- ios: ^18
xcode: ^16
uses: ./.github/workflows/reusable-workflow.yaml
with:
lib: ${{ matrix.app }}
ios: ${{ matrix.ios }}
xcode: ${{ matrix.xcode }}
is_pr: true
build_only: true
secrets: inherit