Skip to content

Commit 687c33d

Browse files
Merge branch 'release/6.0.0'
2 parents 67fe2be + fde7b13 commit 687c33d

File tree

12 files changed

+344
-127
lines changed

12 files changed

+344
-127
lines changed

.github/workflows/codeql.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main", "develop" ]
17+
pull_request:
18+
branches: [ "main", "develop" ]
19+
schedule:
20+
- cron: '20 5 * * 4'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: macos-latest
31+
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
39+
actions: read
40+
contents: read
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- language: actions
47+
build-mode: none
48+
- language: swift
49+
build-mode: manual
50+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
51+
# Use `c-cpp` to analyze code written in C, C++ or both
52+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v5
61+
62+
# Add any setup steps before running the `github/codeql-action/init` action.
63+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
64+
# or others). This is typically only required for manual builds.
65+
# - name: Setup runtime (example)
66+
# uses: actions/setup-example@v1
67+
68+
# Initializes the CodeQL tools for scanning.
69+
- name: Initialize CodeQL
70+
uses: github/codeql-action/init@v3
71+
with:
72+
languages: ${{ matrix.language }}
73+
build-mode: ${{ matrix.build-mode }}
74+
# If you wish to specify custom queries, you can do so here or in a config file.
75+
# By default, queries listed here will override any specified in a config file.
76+
# Prefix the list here with "+" to use these queries and those in the config file.
77+
78+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
79+
# queries: security-extended,security-and-quality
80+
81+
# If the analyze step fails for one of the languages you are analyzing with
82+
# "We were unable to automatically build your code", modify the matrix above
83+
# to set the build mode to "manual" for that language. Then modify this step
84+
# to build your code.
85+
# ℹ️ Command-line programs to run using the OS shell.
86+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
87+
- if: matrix.build-mode == 'manual'
88+
run: |
89+
xcodebuild \
90+
-scheme ShitLib build \
91+
-destination "generic/platform=macOS" \
92+
-skipPackagePluginValidation
93+
94+
- name: Perform CodeQL Analysis
95+
uses: github/codeql-action/analyze@v3
96+
with:
97+
category: "/language:${{matrix.language}}"

.github/workflows/swift.yml

Lines changed: 73 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,84 @@
1-
name: Swift
1+
name: Swift CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, develop ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, develop ]
88

9-
jobs:
10-
build:
9+
permissions:
10+
contents: read
1111

12+
jobs:
13+
test-and-coverage:
14+
name: Test and Coverage (${{ matrix.platform }})
1215
runs-on: macos-latest
1316

17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- platform: "macOS"
22+
destination: "platform=macOS,arch=arm64"
23+
device: "My Mac"
24+
- platform: "iOS"
25+
destination: "platform=iOS Simulator"
26+
device: "iPhone"
27+
- platform: "tvOS"
28+
destination: "platform=tvOS Simulator"
29+
device: "Apple TV"
30+
- platform: "watchOS"
31+
destination: "platform=watchOS Simulator"
32+
device: "Apple Watch"
33+
- platform: "visionOS"
34+
destination: "platform=visionOS Simulator"
35+
device: "Apple Vision"
36+
- platform: "macCatalyst"
37+
destination: "platform=macOS,variant=Mac Catalyst"
38+
device: "My Mac"
39+
1440
steps:
15-
- uses: actions/checkout@v2
16-
- name: Build
17-
run: swift build -v
18-
- name: Run tests
19-
run: swift test -v --enable-code-coverage
41+
- uses: actions/checkout@v5
42+
43+
- name: Run tests on ${{ matrix.platform }}
44+
run: |
45+
# Determine full destination specifier
46+
DEST="${{ matrix.destination }}"
47+
if [[ "${{ matrix.platform }}" != "macOS" && "${{ matrix.platform }}" != "macCatalyst" ]]; then
48+
DEVICE_ID=$(xcrun simctl list devices available \
49+
| grep "${{ matrix.device }}" \
50+
| head -1 \
51+
| awk -F'[()]' '{print $(NF-3)}')
52+
DEST="${DEST},id=${DEVICE_ID}"
53+
fi
54+
55+
echo "Testing on: $DEST"
56+
xcodebuild test \
57+
-scheme ShitLib \
58+
-destination "$DEST" \
59+
-derivedDataPath DerivedData \
60+
-enableCodeCoverage YES \
61+
-skipPackagePluginValidation
62+
2063
- name: Export coverage report as Lcov
21-
run: xcrun llvm-cov export -format="lcov" -instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata .build/x86_64-apple-macosx/debug/ShitLibPackageTests.xctest/Contents/MacOS/ShitLibPackageTests > lcov.info
22-
- uses: codecov/codecov-action@v2
64+
run: |
65+
# Locate profdata and test bundle under DerivedData
66+
PROFILE=$(find DerivedData/Build/ProfileData -name "*.profdata" | head -1)
67+
TEST_BUNDLE=$(find DerivedData/Build/Products -name "*ShitLibPackageTests.xctest" | head -1)
68+
TEST_BINARY="${TEST_BUNDLE}/$(basename "$TEST_BUNDLE" .xctest)"
69+
70+
if [[ -f "$PROFILE" && -f "$TEST_BINARY" ]]; then
71+
echo "Exporting coverage for ${{ matrix.platform }}"
72+
xcrun llvm-cov export -format="lcov" \
73+
-instr-profile="$PROFILE" \
74+
"$TEST_BINARY" > lcov_${{ matrix.platform }}.info
75+
else
76+
echo "Coverage data not found for ${{ matrix.platform }}"
77+
fi
78+
79+
- name: Upload coverage to Codecov
80+
uses: codecov/codecov-action@v5
2381
with:
24-
files: lcov.info
82+
token: ${{ secrets.CODECOV_TOKEN }}
83+
files: lcov_${{ matrix.platform }}.info
84+
flags: ${{ matrix.platform }}

.gitignore

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,7 @@
1-
# OS X
21
.DS_Store
3-
4-
# Xcode
5-
build/
6-
*.pbxuser
7-
!default.pbxuser
8-
*.mode1v3
9-
!default.mode1v3
10-
*.mode2v3
11-
!default.mode2v3
12-
*.perspectivev3
13-
!default.perspectivev3
2+
/.build
3+
/Packages
4+
/*.xcodeproj
145
xcuserdata/
15-
*.xccheckout
16-
profile
17-
*.moved-aside
18-
DerivedData
19-
*.hmap
20-
*.ipa
21-
22-
# Bundler
23-
.bundle
24-
25-
# Add this line if you want to avoid checking in source code from Carthage dependencies.
26-
# Carthage/Checkouts
27-
28-
Carthage/Build
29-
30-
# We recommend against adding the Pods directory to your .gitignore. However
31-
# you should judge for yourself, the pros and cons are mentioned at:
32-
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
33-
#
34-
# Note: if you ignore the Pods directory, make sure to uncomment
35-
# `pod install` in .travis.yml
36-
#
37-
# Pods/
6+
DerivedData/
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

.spi.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version: 1
2+
builder:
3+
configs:
4+
- documentation_targets: [ShitLib]

.swiftlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disabled_rules:
2+
- identifier_name

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [6.0.0] - 2025-09-11
8+
### Changed
9+
- osNull wrapped value must conform to Sendable to comply with Swift 6 rules.
10+
711
## [5.0.0] - 2022-02-27
812
### Changed
913
- Use standard Swift Package structure to be more lightweight and more Xcode syntax coloring and autocomplete friendly.
@@ -36,6 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3640
- Tests with 100% coverage
3741
- Added support for CocoaPods
3842

43+
[6.0.0]: https://github.com/ShitLib/shitlib-swift/compare/5.0.0...6.0.0
44+
[5.0.0]: https://github.com/ShitLib/shitlib-swift/compare/4.0.0...5.0.0
3945
[4.0.0]: https://github.com/ShitLib/shitlib-swift/compare/3.1.0...4.0.0
4046
[3.1.0]: https://github.com/ShitLib/shitlib-swift/compare/3.0.0...3.1.0
4147
[3.0.0]: https://github.com/ShitLib/shitlib-swift/compare/2.0.0...3.0.0

Package.resolved

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:6.1
22

33
import PackageDescription
44

55
let package = Package(
66
name: "ShitLib",
7+
platforms: [
8+
.macOS(.v12), .iOS(.v15), .tvOS(.v15), .watchOS(.v8), .visionOS(.v2), .macCatalyst(.v15)
9+
],
710
products: [
811
.library(
912
name: "ShitLib",
1013
targets: ["ShitLib"])
1114
],
12-
dependencies: [],
15+
dependencies: [
16+
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.59.1")
17+
],
1318
targets: [
1419
.target(
1520
name: "ShitLib",
16-
dependencies: []),
21+
dependencies: [],
22+
plugins: [.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins")]),
1723
.testTarget(
1824
name: "ShitLibTests",
19-
dependencies: ["ShitLib"])
25+
dependencies: ["ShitLib"],
26+
plugins: [.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins")])
2027
]
2128
)

README.md

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# ShitLib (oh Shit!)
22

3-
[![Swift](https://github.com/ShitLib/shitlib-swift/actions/workflows/swift.yml/badge.svg)](https://github.com/ShitLib/shitlib-swift/actions/workflows/swift.yml)
4-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ShitLib_shitlib-swift&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ShitLib_shitlib-swift)
3+
[![Swift CI](https://github.com/ShitLib/shitlib-swift/actions/workflows/swift.yml/badge.svg)](https://github.com/ShitLib/shitlib-swift/actions/workflows/swift.yml?branch=main)
54
[![codecov](https://codecov.io/gh/ShitLib/shitlib-swift/branch/main/graph/badge.svg?token=WqSvdoVifd)](https://codecov.io/gh/ShitLib/shitlib-swift)
65
[![Join the chat at https://gitter.im/ShitLib/shitlib-swift](https://badges.gitter.im/ShitLib/shitlib-swift.svg)](https://gitter.im/ShitLib/shitlib-swift?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
76

@@ -66,39 +65,19 @@ class MyBeautifulUnconfigurableClass {
6665

6766
### Swift Package Manager
6867

69-
ShitLib is compatible with [Swift Package Manager](https://swift.org/package-manager). To use it, add the following as a dependency to your `Package.swift` file:
68+
#### Using Xcode UI
7069

71-
```swift
72-
.package(url: "https://github.com/ShitLib/shitlib-swift.git", .upToNextMajor(from: "5.0.0"))
73-
```
74-
75-
### Other package managers
76-
77-
Since version 5.0.0, support for CocoaPods and Carthage has been discontinued, if you need to use them for any reason, you can use version 4.0.0, since the API isn't changed.
78-
79-
<details><summary>CocoaPods</summary>
80-
<p>
70+
Go to your Project Settings > Swift Packages and add Arachne by entering `https://github.com/ShitLib/shitlib-swift.git` in the search field.
8171

82-
ShitLib till version 4.0.0 is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your `Podfile`:
72+
#### Not using Xcode UI
8373

84-
```ruby
85-
pod 'ShitLib', '~> 4.0'
86-
```
87-
88-
</p>
89-
</details>
90-
91-
<details><summary>Carthage</summary>
92-
<p>
74+
Add the following as a dependency to your `Package.swift`:
9375

94-
ShitLib till version 4.0.0 is compatible with [Carthage](https://github.com/Carthage/Carthage). To use it, add the following line to your `Cartfile`:
95-
96-
```ruby
97-
github "ShitLib/shitlib-swift" ~> 4.0.0
76+
```swift
77+
.package(url: "https://github.com/ShitLib/shitlib-swift.git", .upToNextMajor(from: "6.0.0"))
9878
```
9979

100-
</p>
101-
</details>
80+
and then specify "ShitLib" as a dependency of the Target in which you wish to use it.
10281

10382
## What's new
10483

0 commit comments

Comments
 (0)