Skip to content

Commit

Permalink
Merge pull request #51 from brightdigit/v2.0.0
Browse files Browse the repository at this point in the history
V2.0.0
  • Loading branch information
leogdion authored Sep 20, 2024
2 parents d145a90 + b13245f commit 728bc66
Show file tree
Hide file tree
Showing 137 changed files with 786 additions and 8,996 deletions.
120 changes: 21 additions & 99 deletions .github/workflows/Sublimation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,83 +9,51 @@ jobs:
build-ubuntu:
name: Build on Ubuntu
env:
SWIFT_VER: ${{ matrix.swift-version }}
runs-on: ${{ matrix.runs-on }}
SWIFT_VER: 6.0
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
runs-on: [ubuntu-20.04, ubuntu-22.04]
swift-version: ["5.10"]
runs-on: ubuntu-latest
container:
image: swift:6.0-noble
steps:
- uses: actions/checkout@v4
- name: Set Ubuntu Release DOT
run: echo "RELEASE_DOT=$(lsb_release -sr)" >> $GITHUB_ENV
- name: Set Ubuntu Release NUM
run: echo "RELEASE_NUM=${RELEASE_DOT//[-._]/}" >> $GITHUB_ENV
- name: Set Ubuntu Codename
run: echo "RELEASE_NAME=$(lsb_release -sc)" >> $GITHUB_ENV
- name: Cache swift package modules
id: cache-spm-linux
uses: actions/cache@v4
env:
cache-name: cache-spm
with:
path: .build
key: ${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-${{ matrix.swift-version }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-${{ matrix.swift-version }}-
${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-
- name: Cache swift
id: cache-swift-linux
uses: actions/cache@v4
env:
cache-name: cache-swift
with:
path: swift-${{ env.SWIFT_VER }}-RELEASE-ubuntu${{ env.RELEASE_DOT }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-${{ env.RELEASE_DOT }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-
- name: Download Swift
if: steps.cache-swift-linux.outputs.cache-hit != 'true'
run: curl -O https://download.swift.org/swift-${SWIFT_VER}-release/ubuntu${RELEASE_NUM}/swift-${SWIFT_VER}-RELEASE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz
- name: Extract Swift
if: steps.cache-swift-linux.outputs.cache-hit != 'true'
run: tar xzf swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz
- name: Add Path
run: echo "$GITHUB_WORKSPACE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}/usr/bin" >> $GITHUB_PATH
${{ runner.os }}-${{ env.cache-name }}-
- name: Test
run: swift test --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
id: coverage-files
with:
with:
fail-on-empty-output: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
flags: swift-${{ matrix.swift-version }},ubuntu-${{ matrix.RELEASE_DOT }}
flags: swift-${{ matrix.swift-version }},ubuntu
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
build-macos:
name: Build on macOS
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
include:
- xcode: "/Applications/Xcode_15.3.app"
- xcode: "/Applications/Xcode_16.1.app"
os: macos-14
iOSVersion: "17.2"
watchOSVersion: "10.2"
watchName: "Apple Watch Ultra (49mm)"
iPhoneName: "iPhone 15 Pro"
- xcode: "/Applications/Xcode_15.4.app"
os: macos-14
iOSVersion: "17.4"
watchOSVersion: "10.4"
watchName: "Apple Watch Ultra 2 (49mm)"
iPhoneName: "iPhone 15 Pro Max"
iOSVersion: "18.1"
watchOSVersion: "11.0"
watchName: "Apple Watch Series 9 (41mm)"
iPhoneName: "iPhone 15"
steps:
- uses: actions/checkout@v4
- name: Cache swift package modules
Expand All @@ -99,7 +67,7 @@ jobs:
restore-keys: |
${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-
- name: Cache mint
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_16.1')
id: cache-mint
uses: actions/cache@v4
env:
Expand All @@ -114,9 +82,9 @@ jobs:
- name: Set Xcode Name
run: echo "XCODE_NAME=$(basename -- ${{ matrix.xcode }} | sed 's/\.[^.]*$//' | cut -d'_' -f2)" >> $GITHUB_ENV
- name: Setup Xcode
run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer
run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer || (sudo ls -1 /Applications | grep "Xcode")
- name: Install mint
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_16.1')
run: |
brew update
brew install mint
Expand All @@ -126,7 +94,7 @@ jobs:
run: swift test --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
id: coverage-files-spm
with:
with:
fail-on-empty-output: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -138,12 +106,12 @@ jobs:
run: rm -rf .build
- name: Lint
run: ./scripts/lint.sh
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
if: startsWith(matrix.xcode,'/Applications/Xcode_16.1')
- name: Run iOS target tests
run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }}-Package -sdk "iphonesimulator" -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
- uses: sersoft-gmbh/swift-coverage-action@v4
id: coverage-files-iOS
with:
with:
fail-on-empty-output: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -157,7 +125,7 @@ jobs:
run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }}-Package -sdk "watchsimulator" -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test
- uses: sersoft-gmbh/swift-coverage-action@v4
id: coverage-files-watchOS
with:
with:
fail-on-empty-output: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -167,49 +135,3 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ join(fromJSON(steps.coverage-files-watchOS.outputs.files), ',') }}
flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }}
build-self:
name: Build on Self-Hosting macOS
runs-on: [self-hosted, macOS]
if: github.event.repository.owner.login == github.event.organization.login && !contains(github.event.head_commit.message, 'ci skip')
steps:
- uses: actions/checkout@v4
- name: Cache swift package modules
id: cache-spm-macos
uses: actions/cache@v4
env:
cache-name: cache-spm
with:
path: .build
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache mint
id: cache-mint
uses: actions/cache@v4
env:
cache-name: cache-mint
with:
path: .mint
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Mintfile') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build
run: swift build
- name: Run Swift Package tests
run: swift test --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
with:
fail-on-empty-output: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: macOS,${{ env.XCODE_NAME }}
- name: Clean up spm build directory
run: rm -rf .build
- name: Lint
run: ./scripts/lint.sh
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:

jobs:
analyze:
if: false
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fastlane/test_output
iOSInjectionProject/

### SwiftPackageManager ###
Packages
# Packages
xcuserdata
*.xcodeproj

Expand All @@ -142,3 +142,6 @@ xcuserdata
!Demo/SublimationDemoApp.xcodeproj
.mint
# End of https://www.toptal.com/developers/gitignore/api/swift,swiftpm,swiftpackagemanager,xcode,macos

test_output.log
.docc-build
2 changes: 0 additions & 2 deletions .hound.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .periphery.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
retain_public: true
index_exclude:
- Sources/NgrokOpenAPIClient/*.swift
3 changes: 2 additions & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: 1
builder:
configs:
- documentation_targets: [Ngrokit, Sublimation, SublimationVapor]
- documentation_targets: [Sublimation]
swift_version: 6.0
70 changes: 70 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "fileprivate"
},
"indentation" : {
"spaces" : 2
},
"indentConditionalCompilationBlocks" : true,
"indentSwitchCaseLabels" : true,
"lineBreakAroundMultilineExpressionChainComponents" : true,
"lineBreakBeforeControlFlowKeywords" : true,
"lineBreakBeforeEachArgument" : true,
"lineBreakBeforeEachGenericRequirement" : true,
"lineLength" : 100,
"maximumBlankLines" : 1,
"multiElementCollectionTrailingCommas" : true,
"noAssignmentInExpressions" : {
"allowedFunctions" : [
"XCTAssertNoThrow"
]
},
"prioritizeKeepingFunctionOutputTogether" : false,
"respectsExistingLineBreaks" : false,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : true,
"AlwaysUseLiteralForEmptyCollectionInit" : false,
"AlwaysUseLowerCamelCase" : true,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : true,
"NeverUseForceTry" : true,
"NeverUseImplicitlyUnwrappedOptionals" : true,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoAssignmentInExpressions" : true,
"NoBlockComments" : true,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : true,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoPlaygroundLiterals" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OmitExplicitReturns" : false,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : true,
"OrderedImports" : true,
"ReplaceForEachWithForLoop" : true,
"ReturnVoidInsteadOfEmptyTuple" : true,
"TypeNamesShouldBeCapitalized" : true,
"UseEarlyExits" : false,
"UseExplicitNilCheckInConditions" : true,
"UseLetInEveryBoundCaseVariable" : true,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : true,
"UseSynthesizedInitializer" : true,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : true,
"ValidateDocumentationComments" : true
},
"spacesAroundRangeFormationOperators" : false,
"tabWidth" : 2,
"version" : 1
}
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

7 changes: 0 additions & 7 deletions .swiftformat

This file was deleted.

Loading

0 comments on commit 728bc66

Please sign in to comment.