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
40 changes: 40 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "Swift",
"image": "swiftlang/swift:nightly-6.1-jammy",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
}
},
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root"
}
40 changes: 40 additions & 0 deletions .devcontainer/swift-6.0/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "Swift",
"image": "swift:6.0",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
}
},
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root"
}
40 changes: 40 additions & 0 deletions .devcontainer/swift-6.1/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "Swift",
"image": "swiftlang/swift:nightly-6.1-jammy",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
}
},
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.library": "/usr/lib/liblldb.so"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root"
}
130 changes: 63 additions & 67 deletions .github/workflows/RadiantKit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,37 @@ on:
push:
branches-ignore:
- '*WIP'


env:
PACKAGE_NAME: RadiantKit

jobs:
build-ubuntu:
name: Build on Ubuntu
env:
SWIFT_VER: 6.0
if: "!contains(github.event.head_commit.message, 'ci skip')"
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
image-name: ["swift:6.0-noble", "swiftlang/swift:nightly-6.1-jammy"]
container:
image: swift:6.0
image: ${{ matrix.image-name }}
steps:
- uses: actions/checkout@v4
- 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.cache-name }}-${{ matrix.swift-version }}-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-
${{ runner.os }}-${{ env.cache-name }}-
- name: Test
run: swift test --enable-code-coverage
- uses: brightdigit/swift-build@v1.1.0
- 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
flags: swift-${{ matrix.image-name }},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
env:
PACKAGE_NAME: RadiantKit
runs-on: ${{ matrix.runs-on }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
Expand Down Expand Up @@ -80,67 +70,73 @@ jobs:
deviceName: "Apple Watch Ultra 2 (49mm)"
osVersion: "11.2"

# visionOS Build Matrix
- type: visionos
runs-on: macos-15
xcode: "/Applications/Xcode_16.2.app"
deviceName: "Apple Vision Pro"
osVersion: "2.1"


# tvOS Build Matrix
- type: tvos
runs-on: macos-15
xcode: "/Applications/Xcode_16.2.app"
deviceName: "Apple TV 4K (3rd generation)"
osVersion: "18.2"
steps:
- uses: actions/checkout@v4

- 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

# SPM Cache Step
- name: Cache swift package modules
id: cache-spm-macos
uses: actions/cache@v4
env:
cache-name: cache-spm
- name: Build and Test
uses: brightdigit/swift-build@v1
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: Build SPM
if: "!matrix.type"
run: swift build

- name: Run Swift Package tests
if: "!matrix.type"
run: swift test -v --enable-code-coverage

- name: Enable Swift Testing
run: |
mkdir -p ~/Library/org.swift.swiftpm/security/
cp macros.json ~/Library/org.swift.swiftpm/security/

# Common iOS/watchOS Test Steps
- name: Run Device Tests
if: matrix.type
run: >
xcodebuild test
-scheme ${{ env.PACKAGE_NAME }}-Package
-sdk ${{ matrix.type == 'ios' && 'iphonesimulator' || matrix.type == 'watchos' && 'watchsimulator' || 'xrsimulator' }}
-destination 'platform=${{ matrix.type == 'ios' && 'iOS Simulator' || matrix.type == 'watchos' && 'watchOS Simulator' || 'visionOS Simulator' }},name=${{ matrix.deviceName }},OS=${{ matrix.osVersion }}'
-enableCodeCoverage YES
build test

scheme: ${{ env.PACKAGE_NAME }}-Package
type: ${{ matrix.type }}
xcode: ${{ matrix.xcode }}
deviceName: ${{ matrix.deviceName }}
osVersion: ${{ matrix.osVersion }}

# Common Coverage Steps
- name: Process Coverage
uses: sersoft-gmbh/swift-coverage-action@v4
with:
ignore-conversion-failures: true
search-paths: |
./.build
/Users/runner/work/_temp/DerivedData
fail-on-empty-output: true

- name: Upload Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.type && format('{0}{1}', matrix.type, matrix.osVersion) || 'spm' }}
lint:
name: Linting
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
runs-on: ubuntu-latest
needs: [build-ubuntu, build-macos]
env:
MINT_PATH: .mint/lib
MINT_LINK_PATH: .mint/bin
steps:
- uses: actions/checkout@v4
- name: Cache mint
id: cache-mint
uses: actions/cache@v4
env:
cache-name: cache
with:
path: |
.mint
Mint
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
restore-keys: |
${{ runner.os }}-mint-
- name: Install mint
if: steps.cache-mint.outputs.cache-hit != 'true'
run: |
git clone https://github.com/yonaskolb/Mint.git
cd Mint
swift run mint install yonaskolb/mint
- name: Lint
run: ./Scripts/lint.sh
8 changes: 4 additions & 4 deletions .swift-format
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
]
},
"prioritizeKeepingFunctionOutputTogether" : false,
"respectsExistingLineBreaks" : false,
"respectsExistingLineBreaks" : true,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : true,
"AlwaysUseLiteralForEmptyCollectionInit" : false,
"AlwaysUseLowerCamelCase" : true,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"BeginDocumentationCommentWithOneLineSummary" : true,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FileScopedDeclarationPrivacy" : false,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
Expand Down Expand Up @@ -67,4 +67,4 @@
"spacesAroundRangeFormationOperators" : false,
"tabWidth" : 2,
"version" : 1
}
}
Loading
Loading