Skip to content

Commit

Permalink
feat(sdds-icore): added workflows to run SwiftLint and unit tests (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkaltyrin authored Apr 2, 2024
1 parent a1a523d commit f8d6268
Show file tree
Hide file tree
Showing 50 changed files with 644 additions and 1,379 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Archive XCFrameworks
name: Build Debug / Build debug artifacts

on:
pull_request:
Expand Down Expand Up @@ -36,7 +36,6 @@ jobs:
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
Expand All @@ -48,10 +47,6 @@ jobs:
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Run build script
run: |
chmod +x ./scripts/build.sh
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Code Quality Check / Perform static analysis

on:
pull_request:
paths:
- '.github/workflows/lint.yml'
- '.swiftlint.yml'
- '**/*.swift'

concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
SwiftLint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run SwiftLint
uses: norio-nomura/[email protected]
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Code Quality Check / Perform Unit Testing

on:
pull_request:

concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macos-latest
environment: sdds

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest'

- name: Run tests
run: |
chmod +x ./scripts/test.sh
./scripts/test.sh
6 changes: 4 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ disabled_rules: # rule identifiers turned on by default to exclude from running
- colon
- comma
- control_statement
- trailing_comma
- comment_spacing
opt_in_rules: # some rules are turned off by default, so you need to opt-in
- empty_count # find all the available rules by running: `swiftlint rules`

Expand All @@ -27,7 +29,7 @@ force_try:
severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 110
line_length: 190
# they can set both implicitly with an array
type_body_length:
- 300 # warning
Expand All @@ -47,7 +49,7 @@ type_name:
allowed_symbols: ["_"] # these are allowed in type names
identifier_name:
min_length: # only min_length
error: 4 # only error
error: 3 # only error
excluded: # excluded via string array
- id
- URL
Expand Down
7 changes: 5 additions & 2 deletions SDDS.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f8d6268

Please sign in to comment.