-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial Plugin version #4
Open
rnr
wants to merge
10
commits into
master
Choose a base branch
from
develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6ef647e
chore: initial code commit (#1)
rnr 9157ae7
chore: added github workflows (#2)
rnr 031f2e6
chore: updated readme
rnr 686010c
chore: fix readme
rnr 0cbaaaf
chore: added license, edited readme
rnr 79bae3a
chore: update readme
rnr 29eace8
chore: updated readme
rnr 6ba5fdc
chore: Added unit Tests (#3)
rnr 099024b
chore: address feedback
rnr e2459f6
chore: moved Mock to test target
rnr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Run commitlint on the commit messages in a pull request. | ||
|
||
name: Lint Commit Messages | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
commitlint: | ||
uses: edx/.github/.github/workflows/commitlint.yml@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: SwiftLint | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: SwiftLint | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
run: | ||
xcodes select 16.1 | ||
|
||
- name: SwiftLint | ||
run: | ||
swift package plugin --allow-writing-to-package-directory swiftlint --reporter sarif --output swiftlint.report.sarif | ||
|
||
- name: Prepare swiftlint.report.sarif | ||
if: success() || failure() | ||
run: | ||
swift PrepareSarifToUpload.swift | ||
|
||
- name: Upload report | ||
uses: github/codeql-action/upload-sarif@v3 | ||
if: success() || failure() | ||
with: | ||
sarif_file: swiftlint.report.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This workflow will test a Swift project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift | ||
|
||
name: Unit Tests | ||
|
||
on: | ||
- pull_request | ||
|
||
concurrency: | ||
group: ${{ github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test-ios: | ||
name: iOS 18.1 | ||
runs-on: macos-latest | ||
env: | ||
DEVELOPER_DIR: "/Applications/Xcode_16.1.app/Contents/Developer" | ||
|
||
steps: | ||
# Checkout the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Run Unit Tests | ||
- name: Run tests | ||
run: | | ||
xcodebuild test \ | ||
-scheme EDXMobileAnalytics \ | ||
-sdk iphonesimulator \ | ||
-destination "OS=18.1,name=iPhone 16 Pro" \ | ||
-skipPackagePluginValidation \ | ||
-skipMacroValidation |
mta452 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: XCodeBuild | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
run: | ||
xcodes select 16.1 | ||
|
||
- name: Build | ||
run: | ||
xcodebuild -scheme EDXMobileAnalytics -destination 'platform=iOS Simulator,name=iPhone SE (3rd generation)' -skipPackagePluginValidation -skipMacroValidation build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/configuration/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
warning_threshold: 1 | ||
disabled_rules: # rule identifiers to exclude from running | ||
- identifier_name | ||
- comment_spacing | ||
- force_cast | ||
- empty_count | ||
- nesting | ||
- cyclomatic_complexity | ||
- multiple_closures_with_trailing_closure | ||
# - colon | ||
# - comma | ||
# - control_statement | ||
opt_in_rules: # some rules are only opt-in | ||
- empty_count | ||
# Find all the available rules by running: | ||
# swiftlint rules | ||
#included: # paths to include during linting. `--path` is ignored if present. | ||
# - Source | ||
excluded: # paths to ignore during linting. Takes precedence over `included`. | ||
- .build/* | ||
# - Source/*/ExcludedFile.swift # Exclude files with a wildcard | ||
#analyzer_rules: # Rules run by `swiftlint analyze` (experimental) | ||
# - explicit_self | ||
|
||
# configurable rules can be customized from this configuration file | ||
# binary rules can set their severity level | ||
#force_cast: warning | ||
|
||
force_try: error | ||
|
||
line_length: 120 | ||
type_body_length: 300 | ||
|
||
trailing_whitespace: | ||
ignores_empty_lines: true | ||
|
||
file_length: | ||
warning: 500 | ||
error: 1200 | ||
|
||
function_parameter_count: | ||
warning: 10 | ||
error: 12 | ||
|
||
type_name: | ||
min_length: 3 # only warning | ||
max_length: # warning and error | ||
warning: 40 | ||
error: 50 | ||
excluded: # excluded via string | ||
- iPhone | ||
- API | ||
|
||
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube, markdown) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"configurations" : [ | ||
{ | ||
"id" : "9C579E52-1C40-498C-A511-1565F9BFD1AE", | ||
"name" : "Test Scheme Action", | ||
"options" : { | ||
|
||
} | ||
} | ||
], | ||
"defaultOptions" : { | ||
|
||
}, | ||
"testTargets" : [ | ||
{ | ||
"target" : { | ||
"containerPath" : "container:", | ||
"identifier" : "EDXMobileAnalyticsTests", | ||
"name" : "EDXMobileAnalyticsTests" | ||
} | ||
} | ||
], | ||
"version" : 1 | ||
} |
89 changes: 89 additions & 0 deletions
89
.swiftpm/xcode/xcshareddata/xcschemes/EDXMobileAnalyticsTests.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1620" | ||
version = "2.2"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES" | ||
buildArchitectures = "Automatic"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "NO" | ||
buildForRunning = "YES" | ||
buildForProfiling = "NO" | ||
buildForArchiving = "NO" | ||
buildForAnalyzing = "NO"> | ||
<AutocreatedTestPlanReference> | ||
</AutocreatedTestPlanReference> | ||
</BuildActionEntry> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "NO" | ||
buildForArchiving = "NO" | ||
buildForAnalyzing = "NO"> | ||
<TestPlanReference | ||
reference = "container:.swiftpm/EDXMobileAnalyticsTests.xctestplan"> | ||
</TestPlanReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<TestPlans> | ||
<TestPlanReference | ||
reference = "container:.swiftpm/EDXMobileAnalyticsTests.xctestplan" | ||
default = "YES"> | ||
</TestPlanReference> | ||
</TestPlans> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "EDXMobileAnalyticsTests" | ||
BuildableName = "EDXMobileAnalyticsTests" | ||
BlueprintName = "EDXMobileAnalyticsTests" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "EDXMobileAnalyticsTests" | ||
BuildableName = "EDXMobileAnalyticsTests" | ||
BlueprintName = "EDXMobileAnalyticsTests" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this command
xcodes select 16.1
correct?I believe instead of this
xcode-select
might be a better command.Also is Xcode 16.1 installed on the runner. If not, add a step to install it ina step below: