-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bc7af4
commit 6f26f85
Showing
11 changed files
with
240 additions
and
6 deletions.
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,19 @@ | ||
# Run the workflow that adds new tickets that are either: | ||
# - labelled "DEPR" | ||
# - title starts with "[DEPR]" | ||
# - body starts with "Proposal Date" (this is the first template field) | ||
# to the org-wide DEPR project board | ||
|
||
name: Add newly created DEPR issues to the DEPR project board | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
routeissue: | ||
uses: openedx/.github/.github/workflows/add-depr-ticket-to-depr-board.yml@master | ||
secrets: | ||
GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }} | ||
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }} | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }} |
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,20 @@ | ||
# This workflow runs when a comment is made on the ticket | ||
# If the comment starts with "label: " it tries to apply | ||
# the label indicated in rest of comment. | ||
# If the comment starts with "remove label: ", it tries | ||
# to remove the indicated label. | ||
# Note: Labels are allowed to have spaces and this script does | ||
# not parse spaces (as often a space is legitimate), so the command | ||
# "label: really long lots of words label" will apply the | ||
# label "really long lots of words label" | ||
|
||
name: Allows for the adding and removing of labels via comment | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
add_remove_labels: | ||
uses: openedx/.github/.github/workflows/add-remove-label-on-comment.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,10 @@ | ||
# Run commitlint on the commit messages in a pull request. | ||
|
||
name: Lint Commit Messages | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
commitlint: | ||
uses: openedx/.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,12 @@ | ||
# This workflow runs when a comment is made on the ticket | ||
# If the comment starts with "assign me" it assigns the author to the | ||
# ticket (case insensitive) | ||
|
||
name: Assign comment author to ticket if they say "assign me" | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
self_assign_by_comment: | ||
uses: openedx/.github/.github/workflows/self-assign-issue.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,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 OEXFirebaseAnalytics -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,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
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
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,48 @@ | ||
import Foundation | ||
|
||
let fileName = "swiftlint.report.sarif" | ||
let errorLevel = "error" | ||
let warningThresholdRuleId = "warning_threshold" | ||
|
||
let currentDirectoryURL = URL(fileURLWithPath: FileManager.default.currentDirectoryPath) | ||
let fileURL = currentDirectoryURL.appendingPathComponent(fileName) | ||
|
||
do { | ||
// Load the file data | ||
let data = try Data(contentsOf: fileURL) | ||
|
||
// Decode JSON data | ||
if var jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any], | ||
var runs = jsonObject["runs"] as? [[String: Any]], | ||
!runs.isEmpty { | ||
|
||
if var results = runs[0]["results"] as? [[String: Any]], !results.isEmpty { | ||
// Filter out results based on the condition | ||
results = results.filter { result in | ||
let level = result["level"] as? String | ||
let ruleId = result["ruleId"] as? String | ||
// Keep results that don't match the deletion condition | ||
return !(level == errorLevel && ruleId == warningThresholdRuleId) | ||
} | ||
|
||
// Update the modified results array back into the runs structure | ||
runs[0]["results"] = results | ||
jsonObject["runs"] = runs | ||
|
||
// Encode the updated JSON data back to Data | ||
let updatedData = try JSONSerialization.data(withJSONObject: jsonObject, options: [.prettyPrinted]) | ||
|
||
// Write the updated data back to the file | ||
try updatedData.write(to: fileURL) | ||
print("Filtered JSON file updated successfully.") | ||
} else { | ||
print("No results found to filter.") | ||
} | ||
} else { | ||
print("The JSON structure is not in the expected format.") | ||
} | ||
} catch { | ||
print("Error reading or writing JSON file: \(error.localizedDescription)") | ||
} | ||
|
||
exit(0) |
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