-
Notifications
You must be signed in to change notification settings - Fork 422
77 lines (73 loc) · 2.93 KB
/
pr.yaml
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
name: Pull Request
on:
# Dangerious without Member Check setep!
pull_request_target:
branches:
- dev
jobs:
static-analysis:
runs-on: macos-15
steps:
- name: Member Check
if: ${{ github.event.pull_request.author_association != 'MEMBER' && github.event.pull_request.author_association != 'OWNER' }}
run: |
echo "Pull Request not triggered by a MSDK team member. Someone from the team needs to rerun this workflow AFTER it has been deemed safe."
exit 1
- 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 [email protected]
./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
- name: Report Static Analysis
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd .github/DangerFiles
bundle update && bundle install
bundle exec danger --dangerfile=StaticAnalysis.rb --danger_id=StaticAnalysis
test-orchestrator:
runs-on: macos-15
outputs:
libs: ${{ steps.test-orchestrator.outputs.libs }}
steps:
- name: Member Check
if: ${{ github.event.pull_request.author_association != 'MEMBER' }}
run: |
echo "Pull Request not triggered by a MSDK team member. Someone from the team needs to rerun this workflow AFTER it has been deemed safe."
exit 1
- 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: Determine Tests to Run
id: test-orchestrator
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd .github/DangerFiles
bundle update && bundle install
bundle exec danger --dangerfile=TestOrchestrator.rb
ios-pr:
needs: [test-orchestrator]
strategy:
fail-fast: false
matrix:
lib: ${{ fromJson(needs.test-orchestrator.outputs.libs) }}
uses: ./.github/workflows/reusable-workflow.yaml
with:
lib: ${{ matrix.lib }}
secrets: inherit