Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 5 additions & 40 deletions .github/workflows/api-stability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,8 @@ on:
workflow_dispatch:

jobs:
build_linux:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-22.04, ubuntu-20.04, macos-latest]
swift: ["5.9", "5.8", "5.7"]
name: Check Swift ${{ matrix.swift }} API Stability on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- if: ${{ runner.os == 'Linux' }}
uses: slashmo/install-swift@v0.4.0
with:
version: ${{ matrix.swift }}

- if: ${{ runner.os == 'macOS' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest

- name: Setup SSH Key
run: |
rm -rf ~/.ssh
mkdir -m 0700 ~/.ssh
echo "${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo "${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub
chmod 0600 ~/.ssh/id_ed25519
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

#- name: Reconfigure Private Repo URLs
# run: sed -i 's/git@github.com:/https:\/\/${{ secrets.ACCESS_TOKEN }}@github.com\//g' Package.swift

- name: Check API Stability
run: swift package diagnose-api-breaking-changes `git tag | sort --version-sort | tail -n1`
api-stability:
uses: cpslabgu/swift-workflows/.github/workflows/api-stability.yml@main
secrets:
SSH_PRIVATE_KEY: ${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}
SSH_PUBLIC_KEY: ${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}
43 changes: 8 additions & 35 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,13 @@ on:
branches: [development, main]
pull_request:
branches: [development, main]
schedule:
- cron: '0 16 * * *'
workflow_dispatch:

jobs:
build_linux:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-22.04, ubuntu-20.04]
swift: ["5.9", "5.8", "5.7"]
build_mode: ["debug", "release"]
name: Swift ${{ matrix.swift }} ${{ matrix.build_mode }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- uses: slashmo/install-swift@v0.4.0
with:
version: ${{ matrix.swift }}

- name: Setup SSH Key
run: |
rm -rf ~/.ssh
mkdir -m 0700 ~/.ssh
echo "${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo "${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub
chmod 0600 ~/.ssh/id_ed25519
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

- name: Checkout repo
uses: actions/checkout@v2

#- name: Reconfigure Private Repo URLs
# run: sed -i 's/git@github.com:/https:\/\/${{ secrets.ACCESS_TOKEN }}@github.com\//g' Package.swift

- name: build
run: swift build -c ${{ matrix.build_mode }}

- name: Test
run: swift test -c ${{ matrix.build_mode }}
ci-linux:
uses: cpslabgu/swift-workflows/.github/workflows/ci-linux.yml@main
secrets:
SSH_PRIVATE_KEY: ${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}
SSH_PUBLIC_KEY: ${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}
38 changes: 7 additions & 31 deletions .github/workflows/ci-macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,12 @@ on:
branches: [development, main]
pull_request:
branches: [development, main]
schedule:
- cron: '0 16 * * *'
workflow_dispatch:

jobs:
build_macos:
strategy:
matrix:
os: [macos-14]
build_mode: ["debug", "release"]
name: Swift ${{ matrix.build_mode }} CI for ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
#- name: Install guunits
# uses: mipalgu/install-guunits@main

- name: Setup SSH Key
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}

- name: Checkout repo
uses: actions/checkout@v2

#- name: Reconfigure Private Repo URLs
# run: sed -i 's/git@github.com:/https:\/\/${{ secrets.ACCESS_TOKEN }}@github.com\//g' Package.swift

- name: build
run: swift build -c ${{ matrix.build_mode }}

- name: Test
run: swift test -c ${{ matrix.build_mode }}
ci_macos:
uses: cpslabgu/swift-workflows/.github/workflows/ci-macOS.yml@main
secrets:
SSH_PRIVATE_KEY: ${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}
41 changes: 7 additions & 34 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,39 +60,12 @@ on:
branches: [development, main]
pull_request:
branches: [development, main]
schedule:
- cron: '0 16 * * *'
workflow_dispatch:

jobs:
build_windows:
strategy:
matrix:
os: [windows-latest, "windows-2022"]
swift: ["5.9", "5.8", "5.7"]
build_mode: ["debug", "release"]
name: Swift ${{ matrix.swift }} ${{ matrix.build_mode }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- name: Setup Swift
uses: compnerd/gha-setup-swift@v0.2.1
with:
branch: swift-${{ matrix.swift }}-release
tag: ${{ matrix.swift }}-RELEASE

- name: Checkout repo
uses: actions/checkout@v2

- name: Setup SSH Key
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}

#- name: Reconfigure Private Repo URLs
# run: sed -i 's/git@github.com:/https:\/\/${{ secrets.ACCESS_TOKEN }}@github.com\//g' Package.swift

- name: build
run: |
swift package purge-cache
swift build -c ${{ matrix.build_mode }}

- name: Test
run: swift test -c ${{ matrix.build_mode }}
ci-windows:
uses: cpslabgu/swift-workflows/.github/workflows/ci-windows.yml@main
secrets:
SSH_PRIVATE_KEY: ${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}
50 changes: 7 additions & 43 deletions .github/workflows/cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,10 @@ on:
branches: [development, main]

jobs:

exec-cov:
runs-on: ubuntu-20.04

steps:
- uses: slashmo/install-swift@v0.4.0
with:
version: "5.9"

- name: Setup SSH Key
run: |
rm -rf ~/.ssh
mkdir -m 0700 ~/.ssh
echo "${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo "${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub
chmod 0600 ~/.ssh/id_ed25519
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

- name: Checkout repo
uses: actions/checkout@v2

#- name: Reconfigure Private Repo URLs
# run: sed -i 's/git@github.com:/https:\/\/${{ secrets.ACCESS_TOKEN }}@github.com\//g' Package.swift

- name: Run tests
run: swift test --enable-code-coverage

- name: Coverage Test
uses: mattpolzin/swift-codecov-action@0.7.3
id: cov
with:
MINIMUM_COVERAGE: 98

- name: Post Positive Result
if: ${{ success() }}
run: |
echo "::warning file=Package.swift,line=1,col=1::The current code coverage percentage is passing with ${{ steps.cov.outputs.codecov }} (minimum allowed: ${{ steps.cov.outputs.minimum_coverage }}%)."

- name: Post Negative Result
if: ${{ failure() }}
run: |
echo "::error file=Package.swift,line=1,col=1::The current code coverage percentage is failing with ${{ steps.cov.outputs.codecov }} (minimum allowed: ${{ steps.cov.outputs.minimum_coverage }}%)."
cov:
uses: cpslabgu/swift-workflows/.github/workflows/cov.yml@main
with:
MINIMUM_COVERAGE: 90
secrets:
SSH_PRIVATE_KEY: ${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}
SSH_PUBLIC_KEY: ${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}
39 changes: 6 additions & 33 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,9 @@ on:
branches: [ main ]

jobs:

exec-jazzy:
runs-on: ubuntu-20.04

steps:
- uses: slashmo/install-swift@v0.4.0
with:
version: "5.9"

- name: Setup SSH Key
run: |
rm -rf ~/.ssh
mkdir -m 0700 ~/.ssh
echo "${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo "${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub
chmod 0600 ~/.ssh/id_ed25519
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

- name: Clone Repo
uses: actions/checkout@v2

- name: Generate Documentation
uses: mipalgu/swiftpm-generate-documentation@main
with:
swift-version: "5.9"

- name: Pages Deployment
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
force_orphan: true
docs:
uses: cpslabgu/swift-workflows/.github/workflows/docs.yml@main
secrets:
SSH_PRIVATE_KEY: ${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}
SSH_PUBLIC_KEY: ${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 7 additions & 14 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,13 @@ on:
branches: [development, main]
pull_request:
branches: [development, main]
schedule:
- cron: '0 16 * * *'
workflow_dispatch:

jobs:

swiftlint:
runs-on: ubuntu-20.04

steps:
- name: Clone Repo
uses: actions/checkout@v2

#- name: Reconfigure Private Repo URLs
# run: sed -i 's/git@github.com:/https:\/\/${{ secrets.ACCESS_TOKEN }}@github.com\//g' Package.swift

- name: SwiftLint
uses: norio-nomura/action-swiftlint@3.2.1
with:
args: --strict
uses: cpslabgu/swift-workflows/.github/workflows/swiftlint.yml@main
secrets:
SSH_PRIVATE_KEY: ${{ secrets.WORKFLOWS_SSH_PRIVATE_KEY }}
SSH_PUBLIC_KEY: ${{ secrets.WORKFLOWS_SSH_PUBLIC_KEY }}
56 changes: 56 additions & 0 deletions .swiftformat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"indentation" : {
"spaces" : 4
},
"indentConditionalCompilationBlocks" : false,
"indentSwitchCaseLabels" : false,
"lineBreakAroundMultilineExpressionChainComponents" : true,
"lineBreakBeforeControlFlowKeywords" : false,
"lineBreakBeforeEachArgument" : true,
"lineBreakBeforeEachGenericRequirement" : true,
"lineLength" : 110,
"maximumBlankLines" : 1,
"prioritizeKeepingFunctionOutputTogether" : false,
"respectsExistingLineBreaks" : true,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : true,
"AlwaysUseLowerCamelCase" : true,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : true,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : false,
"NeverUseForceTry" : false,
"NeverUseImplicitlyUnwrappedOptionals" : false,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoBlockComments" : false,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : true,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : true,
"OrderedImports" : false,
"ReturnVoidInsteadOfEmptyTuple" : true,
"UseEarlyExits" : false,
"UseLetInEveryBoundCaseVariable" : true,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : true,
"UseSynthesizedInitializer" : true,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : true,
"ValidateDocumentationComments" : false
},
"tabWidth" : 8,
"version" : 1
}
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
disabled_rules: # rule identifiers turned on by default to exclude from running
- inclusive_language
- superfluous_disable_command
- trailing_comma
opt_in_rules: # some rules are turned off by default, so you need to opt-in
# Find all the available rules by running: `swiftlint rules`
- array_init
Expand Down
Loading
Loading