Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
8806f86
Add Github Actions
brandonpage Oct 31, 2024
97f6ddc
test
brandonpage Oct 31, 2024
de83952
no message
brandonpage Oct 31, 2024
66511bd
no message
brandonpage Oct 31, 2024
01bfd90
no message
brandonpage Nov 1, 2024
b978d06
no message
brandonpage Nov 1, 2024
4ccf820
no message
brandonpage Nov 1, 2024
de24249
no message
brandonpage Nov 1, 2024
7a9becc
no message
brandonpage Nov 1, 2024
a28b276
no message
brandonpage Nov 1, 2024
325f09c
no message
brandonpage Nov 1, 2024
aa06a4c
no message
brandonpage Nov 1, 2024
752b3d2
no message
brandonpage Nov 1, 2024
137be15
no message
brandonpage Nov 1, 2024
2c72f4e
no message
brandonpage Nov 1, 2024
a5354ea
no message
brandonpage Nov 1, 2024
98074cd
no message
brandonpage Nov 1, 2024
2ae8655
no message
brandonpage Nov 1, 2024
452ddde
no message
brandonpage Nov 1, 2024
07396a0
no message
brandonpage Nov 1, 2024
a14ab89
no message
brandonpage Nov 1, 2024
6d19ba4
no message
brandonpage Nov 1, 2024
43f1eb8
no message
brandonpage Nov 1, 2024
5b9ea6e
no message
brandonpage Nov 1, 2024
69ffdc2
no message
brandonpage Nov 1, 2024
2febc8d
no message
brandonpage Nov 1, 2024
e064f3e
no message
brandonpage Nov 1, 2024
d723019
no message
brandonpage Nov 1, 2024
a4fac78
no message
brandonpage Nov 1, 2024
fa8f1e3
no message
brandonpage Nov 1, 2024
78369ab
no message
brandonpage Nov 1, 2024
16bb938
no message
brandonpage Nov 2, 2024
087ea08
no message
brandonpage Nov 2, 2024
999991c
no message
brandonpage Nov 2, 2024
430a609
no message
brandonpage Nov 2, 2024
b4df271
no message
brandonpage Nov 2, 2024
5e82b4b
no message
brandonpage Nov 2, 2024
4c268bd
no message
brandonpage Nov 2, 2024
6d3d15d
no message
brandonpage Nov 2, 2024
9efe69e
no message
brandonpage Nov 2, 2024
2ddec13
no message
brandonpage Nov 2, 2024
98a7677
no message
brandonpage Nov 2, 2024
2086d39
no message
brandonpage Nov 2, 2024
0ad403a
no message
brandonpage Nov 2, 2024
74f40c2
no message
brandonpage Nov 2, 2024
fc0d3f3
no message
brandonpage Nov 2, 2024
5908cab
no message
brandonpage Nov 2, 2024
6fd4134
no message
brandonpage Nov 2, 2024
51117f1
no message
brandonpage Nov 2, 2024
2f644fb
no message
brandonpage Nov 2, 2024
c515d91
no message
brandonpage Nov 4, 2024
a52ae5f
no message
brandonpage Nov 4, 2024
3bb5eee
no message
brandonpage Nov 4, 2024
bd3a76d
no message
brandonpage Nov 4, 2024
8ea98ed
no message
brandonpage Nov 4, 2024
650dc58
no message
brandonpage Nov 4, 2024
5056a6e
no message
brandonpage Nov 4, 2024
4e81156
no message
brandonpage Nov 4, 2024
c0c4b3b
no message
brandonpage Nov 4, 2024
56a5e85
no message
brandonpage Nov 4, 2024
274b7ac
no message
brandonpage Nov 4, 2024
66aa1a9
no message
brandonpage Nov 4, 2024
5ed6f3e
no message
brandonpage Nov 4, 2024
81f0101
no message
brandonpage Nov 4, 2024
9f91891
no message
brandonpage Nov 4, 2024
8f160ee
no message
brandonpage Nov 4, 2024
cfa15e7
no message
brandonpage Nov 4, 2024
123612d
no message
brandonpage Nov 4, 2024
6a78038
no message
brandonpage Nov 4, 2024
b5e76c9
no message
brandonpage Nov 4, 2024
c6ab473
no message
brandonpage Nov 4, 2024
c146cf4
no message
brandonpage Nov 4, 2024
74db84d
no message
brandonpage Nov 4, 2024
0cc9f51
no message
brandonpage Nov 4, 2024
adea0a0
no message
brandonpage Nov 5, 2024
8565cb8
no message
brandonpage Nov 5, 2024
433a250
no message
brandonpage Nov 5, 2024
7c0dad4
no message
brandonpage Nov 5, 2024
bf7f9f6
no message
brandonpage Nov 5, 2024
81e955b
no message
brandonpage Nov 5, 2024
49a1e29
test xcbeautify
brandonpage Nov 14, 2024
7adece6
Adjust for new single xcode version per macos image.
brandonpage Nov 14, 2024
93a5d51
no message
brandonpage Nov 14, 2024
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
5 changes: 5 additions & 0 deletions .github/DangerFiles/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source("https://rubygems.org")

gem 'danger'
gem 'plist'
gem 'danger-xcode_summary'
82 changes: 82 additions & 0 deletions .github/DangerFiles/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
base64 (0.2.0)
claide (1.1.0)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
colored2 (3.1.2)
cork (0.3.0)
colored2 (~> 3.1)
danger (9.5.1)
base64 (~> 0.2)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
cork (~> 0.1)
faraday (>= 0.9.0, < 3.0)
faraday-http-cache (~> 2.0)
git (~> 1.13)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
octokit (>= 4.0)
pstore (~> 0.1)
terminal-table (>= 1, < 4)
danger-plugin-api (1.0.0)
danger (> 2.0)
danger-xcode_summary (1.3.1)
danger-plugin-api (~> 1.0)
xcresult (~> 0.2.2)
faraday (2.12.0)
faraday-net_http (>= 2.0, < 3.4)
json
logger
faraday-http-cache (2.5.1)
faraday (>= 0.8)
faraday-net_http (3.3.0)
net-http
git (1.19.1)
addressable (~> 2.8)
rchardet (~> 1.8)
json (2.7.5)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
logger (1.6.1)
nap (1.1.0)
net-http (0.4.1)
uri
octokit (9.2.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
open4 (1.3.4)
plist (3.7.1)
pstore (0.1.3)
public_suffix (6.0.1)
rchardet (1.8.0)
rexml (3.3.9)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.6.0)
uri (0.13.1)
xcresult (0.2.2)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
danger
danger-xcode_summary
plist

BUNDLED WITH
2.5.22
44 changes: 44 additions & 0 deletions .github/DangerFiles/StaticAnalysis.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
require 'plist'

# Markdown table character length without any issues
MAKRDOWN_LENGTH = 138
LIBS = ['SalesforceSDKCommon', 'SalesforceAnalytics', 'SalesforceSDKCore', 'SmartStore', 'MobileSync']

files = Set[]
for lib in LIBS;
files.merge(Dir["../../libs/#{lib}/clangReport/StaticAnalyzer/#{lib}/#{lib}/normal/**/*.plist"])
end
print "Found #{files.count} classes with static analysis files."

modified_file_names = git.modified_files.map { |file| File.basename(file, File.extname(file)) }
added_file_names = git.added_files.map { |file| File.basename(file, File.extname(file)) }

# Github PR comment header
message = "### Clang Static Analysis Issues\n\n"
message << "File | Type | Category | Description | Line | Col |\n"
message << " --- | ---- | -------- | ----------- | ---- | --- |\n"

# Parse Clang Plist files and report issues associated with files modified or added in this PR.
for file in files;
report = Plist.parse_xml(file)
report_file_name = File.basename(file, File.extname(file))
print "file name: #{report_file_name}\n"

if modified_file_names.include?(report_file_name) || added_file_names.include?(report_file_name)
print "file match! #{file}\n"
issues = report['diagnostics']
print "issue count: #{issues.count}\n"
for i in 0..issues.count-1
unless issues[i].nil?
print "#{report_file_name} | #{issues[i]['type']} | #{issues[i]['category']} | #{issues[i]['description']} | #{issues[i]['location']['line']} | #{issues[i]['location']['col']}\n"
message << "#{report_file_name} | #{issues[i]['type']} | #{issues[i]['category']} | #{issues[i]['description']} | #{issues[i]['location']['line']} | #{issues[i]['location']['col']}\n"
end
end
end
end

# Only print Static Analysis table if there are issues
if message.length > MAKRDOWN_LENGTH
warn('Static Analysis found an issue with one or more files you modified. Please fix the issue(s).')
markdown message
end
24 changes: 24 additions & 0 deletions .github/DangerFiles/TestOrchestrator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# List of supported xcode schemes for testing
# SCHEMES = ['SalesforceSDKCore', 'MobileSync', 'SmartStore']
SCHEMES = ['SalesforceSDKCommon', 'SalesforceAnalytics', 'SalesforceSDKCore', 'SmartStore', 'MobileSync']

modifed_libs = Set[]
for file in (git.modified_files + git.added_files);
scheme = file.split("libs/").last.split("/").first
print "lib: #{scheme}\n"
if scheme == '.github'
# If CI files are modified, run all tests
modifed_libs.merge(SCHEMES)
elsif SCHEMES.include?(scheme)
modifed_libs.add(scheme)
end
end

# TODO: REMOVE THIS
modifed_libs.delete(".github")
print "modifed libs: #{modifed_libs}\n"
print "modifed libs as list: [#{modifed_libs.join(", ")}]\n"

# Set Github Job output so we know which tests to run
json_libs = modifed_libs.map { |l| "'#{l}'"}.join(", ")
`echo "libs=[#{json_libs}]" >> $GITHUB_OUTPUT`
8 changes: 8 additions & 0 deletions .github/DangerFiles/TestResults.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
xcode_summary.ignores_warnings = true
xcode_summary.inline_mode = true

if File.exist?('../../test.xcresult')
xcode_summary.report '../../test.xcresult'
else
fail "No test results found."
end
82 changes: 82 additions & 0 deletions .github/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
base64 (0.2.0)
claide (1.1.0)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
colored2 (3.1.2)
cork (0.3.0)
colored2 (~> 3.1)
danger (9.5.1)
base64 (~> 0.2)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
cork (~> 0.1)
faraday (>= 0.9.0, < 3.0)
faraday-http-cache (~> 2.0)
git (~> 1.13)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
octokit (>= 4.0)
pstore (~> 0.1)
terminal-table (>= 1, < 4)
danger-plugin-api (1.0.0)
danger (> 2.0)
danger-xcode_summary (1.3.1)
danger-plugin-api (~> 1.0)
xcresult (~> 0.2.2)
faraday (2.12.0)
faraday-net_http (>= 2.0, < 3.4)
json
logger
faraday-http-cache (2.5.1)
faraday (>= 0.8)
faraday-net_http (3.3.0)
net-http
git (1.19.1)
addressable (~> 2.8)
rchardet (~> 1.8)
json (2.7.5)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
logger (1.6.1)
nap (1.1.0)
net-http (0.4.1)
uri
octokit (9.2.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
open4 (1.3.4)
plist (3.7.1)
pstore (0.1.3)
public_suffix (6.0.1)
rchardet (1.8.0)
rexml (3.3.9)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.6.0)
uri (0.13.1)
xcresult (0.2.2)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
danger
danger-xcode_summary
plist

BUNDLED WITH
2.5.22
23 changes: 23 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Nightly Tests

on:
schedule:
- cron: "0 5 * * 3,5" # cron is UTC, this translates to 10 PM PST Tues and Thur.

jobs:
ios-pr:
strategy:
fail-fast: false
matrix:
lib: [SalesforceSDKCommon, SalesforceAnalytics, SalesforceSDKCore, SmartStore, MobileSync]
ios: [^18, ^17]
include:
- ios: ^18
macos: macos-15
- ios: ^17
macos: macos-14
uses: ./.github/workflows/reusable-workflow.yaml
with:
lib: ${{ matrix.lib }}
ios: ${{ matrix.ios }}
macos: ${{ matrix.macos }}
61 changes: 61 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Pull Request

on:
pull_request:
# branches:
# - dev

jobs:
static-analysis:
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 100
- name: Install Dependencies
run: |
npm install [email protected]
./install.sh
# - name: Run Static Analysis
# run: set -o pipefail && xcodebuild analyze -workspace SalesforceMobileSDK.xcworkspace -scheme MobileSync -sdk 'iphonesimulator' \
# CLANG_ANALYZER_OUTPUT=plist-html CLANG_ANALYZER_OUTPUT_DIR=./clangReport RUN_CLANG_STATIC_ANALYZER=YES | xcbeautify --renderer github-actions
- name: Run Static Analysis
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: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 100
- 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
Loading
Loading