Skip to content

Commit d34bde8

Browse files
RD-635: Add security action (#66)
1 parent 86e8bea commit d34bde8

File tree

8 files changed

+76
-5
lines changed

8 files changed

+76
-5
lines changed

.github/workflows/codeql.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze (${{ matrix.language }})
12+
runs-on: macos-latest
13+
permissions:
14+
security-events: write
15+
packages: read
16+
actions: read
17+
contents: read
18+
19+
strategy:
20+
fail-fast: true
21+
matrix:
22+
include:
23+
- language: actions
24+
build-mode: none
25+
- language: javascript-typescript
26+
build-mode: none
27+
- language: swift
28+
build-mode: manual
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@v3
34+
with:
35+
languages: ${{ matrix.language }}
36+
build-mode: ${{ matrix.build-mode }}
37+
queries: security-extended
38+
- name: Set Up Swift
39+
uses: maxim-lobanov/setup-xcode@592f3a0ea6269bc3452fd67ae771c3174f6d01cf
40+
with:
41+
xcode-version: '16.2'
42+
- name: Verify Swift Version
43+
run: swift --version
44+
- name: Verify Xcode version
45+
run: xcodebuild -version
46+
- name: Build Swift
47+
run: xcodebuild -scheme MapTilerSDK -destination 'platform=iOS Simulator,name=iPhone 16'
48+
- name: Perform CodeQL Analysis
49+
uses: github/codeql-action/analyze@v3
50+
with:
51+
category: "/language:${{matrix.language}}"

.github/workflows/lint.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ jobs:
2525
swiftlint-${{ runner.os }}-
2626
- name: Install SwiftLint
2727
if: steps.cache.outputs.cache-hit != 'true'
28-
run: brew install swiftlint
28+
run: |
29+
if ! command -v swiftlint &> /dev/null; then
30+
brew install swiftlint
31+
fi
32+
- name: Link SwiftLint
33+
run: brew link swiftlint --force
2934
- name: Run SwiftLint
3035
run: swiftlint --strict

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717
- name: Set Up Swift
18-
uses: maxim-lobanov/setup-xcode@v1
18+
uses: maxim-lobanov/setup-xcode@592f3a0ea6269bc3452fd67ae771c3174f6d01cf
1919
with:
2020
xcode-version: '16.2'
2121
- name: Verify Swift Version

CHANGELOG.md

Whitespace-only changes.

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Contribute
2+
3+
We welcome and appreciate different types of contributions:
4+
- **Bug Reports**: Any bug you find can be filed under new issue.
5+
- **Suggestions for Improvements**: If you have any enhancement suggestions, we would love to hear from you.
6+
7+
For any additional questions regarding anything else MapTiler related, feel free to contact us at [email protected].

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ The MapTiler SDK Swift is a native SDK written in Swift, designed to work with t
2525
Make sure to set your MapTiler Cloud API key first. (i.e. in AppDelegate):
2626

2727
```swift
28-
MTConfig.shared.setAPIKey("YOUR_API_KEY")
28+
Task {
29+
await MTConfig.shared.setAPIKey("YOUR_API_KEY")
30+
}
2931
```
3032

3133
### UIKit
@@ -172,8 +174,9 @@ In addition to `MTMarker` and `MTTextPopup`, you can use `MTCustomAnnotationView
172174
```swift
173175
let customSize = CGSize(width: 200.0, height: 80.0)
174176
let coordinates = CLLocationCoordinate2D(latitude: 47.137765, longitude: 8.581651)
177+
let offset = MTPoint(x: 0, y: -80)
175178

176-
let myCustomView = MTCustomAnnotationView(size: customSize, coordinates: coordinates)
179+
let myCustomView = MTCustomAnnotationView(size: customSize, coordinates: coordinates, offset: offset)
177180
myCustomView.backgroundColor = .blue
178181

179182
myCustomView.addTo(mapView)

Sources/MapTilerSDK/Annotations/MTMarker.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ public class MTMarker: MTAnnotation, MTMapViewContent, @unchecked Sendable {
124124
public func attachAnnotationView(_ view: MTCustomAnnotationView) {
125125
self.annotationView = view
126126
}
127+
128+
/// Detaches custom annotation view from the marker.
129+
public func detachAnnotationView() {
130+
self.annotationView = nil
131+
}
127132
}
128133

129134
// Concurrency

Sources/MapTilerSDK/Logging/MTLogger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class MTLogger {
4242

4343
package actor MTLoggerInternal {
4444
package enum Constants {
45-
static let maxLogCount: Int = 5000
45+
static let maxLogCount: Int = 8000
4646
static let maxCountExceededMessage: String =
4747
"Maximum in-memory log count exceeded, earliest logs now accessible only through OS Logs."
4848
}

0 commit comments

Comments
 (0)