Skip to content

Commit

Permalink
v2.0.0-alpha.1 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion authored Feb 4, 2024
1 parent f88be21 commit f494061
Show file tree
Hide file tree
Showing 101 changed files with 6,557 additions and 905 deletions.
117 changes: 73 additions & 44 deletions .github/workflows/Sublimation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
strategy:
matrix:
runs-on: [ubuntu-20.04, ubuntu-22.04]
swift-version: [5.7.3, 5.8, 5.9]
swift-version: [5.9]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set Ubuntu Release DOT
run: echo "RELEASE_DOT=$(lsb_release -sr)" >> $GITHUB_ENV
- name: Set Ubuntu Release NUM
Expand All @@ -24,7 +24,7 @@ jobs:
run: echo "RELEASE_NAME=$(lsb_release -sc)" >> $GITHUB_ENV
- name: Cache swift package modules
id: cache-spm-linux
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-spm
with:
Expand All @@ -35,7 +35,7 @@ jobs:
${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-
- name: Cache swift
id: cache-swift-linux
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-swift
with:
Expand All @@ -51,35 +51,50 @@ jobs:
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
- name: Build
run: swift build
- name: Test
run: swift test --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
id: coverage-files
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 }}
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
build-macos:
name: Build on macOS
runs-on: macos-13
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
include:
- xcode: "/Applications/Xcode_14.2.app"
iOSVersion: "16.2"
watchOSVersion: "9.1"
watchName: "Apple Watch Ultra (49mm)"
iPhoneName: "iPhone 14"
- xcode: "/Applications/Xcode_14.3.1.app"
iOSVersion: "16.4"
watchOSVersion: "9.4"
watchName: "Apple Watch Ultra (49mm)"
iPhoneName: "iPhone 14 Pro Max"
- xcode: "/Applications/Xcode_15.0.1.app"
iOSVersion: "17.0"
os: macos-13
iOSVersion: "17.0.1"
watchOSVersion: "10.0"
watchName: "Apple Watch Ultra 2 (49mm)"
iPhoneName: "iPhone 14 Pro Max"
watchName: "Apple Watch Series 9 (41mm)"
iPhoneName: "iPhone 15 Pro"
- xcode: "/Applications/Xcode_15.1.app"
os: macos-13
iOSVersion: "17.2"
watchOSVersion: "10.2"
watchName: "Apple Watch Series 9 (45mm)"
iPhoneName: "iPhone 15 Pro"
- xcode: "/Applications/Xcode_15.2.app"
os: macos-14
iOSVersion: "17.2"
watchOSVersion: "10.2"
watchName: "Apple Watch Ultra (49mm)"
iPhoneName: "iPhone 15 Pro Max"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache swift package modules
id: cache-spm-macos
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-spm
with:
Expand All @@ -88,9 +103,9 @@ jobs:
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-
- name: Cache mint
if: startsWith(matrix.xcode,'/Applications/Xcode_15.0.1')
if: startsWith(matrix.xcode,'/Applications/Xcode_15.2')
id: cache-mint
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-mint
with:
Expand All @@ -105,15 +120,29 @@ jobs:
- name: Setup Xcode
run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer
- name: Install mint
if: startsWith(matrix.xcode,'/Applications/Xcode_15.0.1')
if: startsWith(matrix.xcode,'/Applications/Xcode_15.2')
run: |
brew update
brew install mint
- name: Build
run: swift build
# - name: Run Swift Package tests
# run: swift test -v --enable-code-coverage
# - uses: sersoft-gmbh/swift-coverage-action@v4
# id: coverage-files
# with:
# fail-on-empty-output: true
# - name: Upload SPM coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# fail_ci_if_error: true
# flags: SPM
# verbose: true
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
- name: Lint
run: ./scripts/lint.sh
if: startsWith(matrix.xcode,'/Applications/Xcode_15.0.1')
if: startsWith(matrix.xcode,'/Applications/Xcode_15.2')
# - name: Dump PIF
# if: startsWith(matrix.xcode,'/Applications/Xcode_14')
# run: |
Expand All @@ -125,22 +154,22 @@ jobs:
# ATTEMPT=$(($ATTEMPT+1))
# done
- name: Run iOS target tests
run: xcodebuild build -scheme Sublimation -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName}},OS=${{ matrix.iOSVersion }}'
# - uses: sersoft-gmbh/swift-coverage-action@v2
# - name: Upload iOS coverage to Codecov
# uses: codecov/codecov-action@v2
# with:
# fail_ci_if_error: true
# flags: iOS,iOS-${{ matrix.iOSVersion }}
# verbose: true
# token: ${{ secrets.CODECOV_TOKEN }}
run: xcodebuild build test -scheme Sublimation-Package -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName}},OS=${{ matrix.iOSVersion }}'
- uses: sersoft-gmbh/swift-coverage-action@v4
- name: Upload iOS coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
flags: iOS,iOS-${{ matrix.iOSVersion }}
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run watchOS target tests
run: xcodebuild build -scheme Sublimation -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}'
# - uses: sersoft-gmbh/swift-coverage-action@v2
# - name: Upload watchOS coverage to Codecov
# uses: codecov/codecov-action@v2
# with:
# fail_ci_if_error: true
# flags: watchOS,watchOS${{ matrix.watchOSVersion }}
# verbose: true
# token: ${{ secrets.CODECOV_TOKEN }}
run: xcodebuild build test -scheme Sublimation-Package -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}'
- uses: sersoft-gmbh/swift-coverage-action@v4
- name: Upload watchOS coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
flags: watchOS,watchOS${{ matrix.watchOSVersion }}
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
26 changes: 10 additions & 16 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on: ${{ (matrix.language == 'swift' && 'macos-13') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
Expand All @@ -47,11 +47,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Xcode
run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -64,20 +67,11 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Build
run: swift build

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- run: |
echo "Run, Build Application using script"
swift build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
1 change: 0 additions & 1 deletion .periphery.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .strict.stringslint.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .stringslint.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--indent 2
--header strip
--header "\n .*?\.swift\n Sublimation\n\n Created by Leo Dion.\n Copyright © {year} BrightDigit.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation\n files (the “Software”), to deal in the Software without\n restriction, including without limitation the rights to use,\n copy, modify, merge, publish, distribute, sublicense, and/or\n sell copies of the Software, and to permit persons to whom the\n Software is furnished to do so, subject to the following\n conditions:\n \n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n"
--commas inline
--disable wrapMultilineStatementBraces
--disable wrapMultilineStatementBraces, redundantInternal
--extensionacl on-declarations
--decimalgrouping 3,4
--exclude .build, DerivedData, .swiftpm
--exclude .build, DerivedData, .swiftpm, Sources/NgrokOpenAPIClient, Demo
26 changes: 14 additions & 12 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
opt_in_rules:
- anyobject_protocol
- array_init
- attributes
- closure_body_length
Expand All @@ -22,14 +21,13 @@ opt_in_rules:
- expiring_todo
- explicit_acl
- explicit_init
- explicit_self
- explicit_top_level_acl
- fallthrough
- fatal_error_message
- file_header
- file_name
- file_name_no_space
- file_types_order
- first_where
- flatmap_over_map_reduce
- force_unwrapping
- function_default_parameter_at_end
Expand All @@ -44,9 +42,9 @@ opt_in_rules:
- legacy_random
- literal_expression_end_indentation
- lower_acl_than_parent
#- missing_docs
- missing_docs
- modifier_order
#- multiline_arguments
- multiline_arguments
- multiline_arguments_brackets
- multiline_function_chains
- multiline_literal_brackets
Expand Down Expand Up @@ -82,19 +80,22 @@ opt_in_rules:
- strong_iboutlet
- switch_case_on_newline
- toggle_bool
#- trailing_closure
- trailing_closure
- type_contents_order
- unavailable_function
- unneeded_parentheses_in_closure_argument
- unowned_variable_capture
- unused_declaration
- unused_import
- untyped_error_in_catch
- vertical_parameter_alignment_on_call
- vertical_whitespace_between_cases
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- xct_specific_matcher
- yoda_condition
analyzer_rules:
- explicit_self
- unused_declaration
- unused_import
cyclomatic_complexity:
- 6
- 9
Expand All @@ -105,21 +106,22 @@ file_length:
- 400
- 800
function_body_length:
- 25
- 26
- 40
function_parameter_count: 8
line_length:
- 90
- 90
generic_type_name:
max_length: 40
identifier_name:
excluded:
- id
excluded:
- Tests
- DerivedData
- .build
- .swiftpm
- Demo/SublimationDemoServer/.build
- Demo/SublimationDemoServer/.swiftpm
- Demo
- Sources/NgrokOpenAPIClient
indentation_width:
indentation_width: 2
7 changes: 0 additions & 7 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

This file was deleted.

Loading

0 comments on commit f494061

Please sign in to comment.