Skip to content

Commit ff0704b

Browse files
committed
v1.0.0-alpha.1
0 parents  commit ff0704b

31 files changed

+2450
-0
lines changed
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
name: macOS
2+
on:
3+
push:
4+
branches-ignore:
5+
- '*WIP'
6+
env:
7+
PACKAGE_NAME: AviaryInsights
8+
jobs:
9+
build-ubuntu:
10+
name: Build on Ubuntu
11+
env:
12+
SWIFT_VER: ${{ matrix.swift-version }}
13+
runs-on: ${{ matrix.runs-on }}
14+
if: "!contains(github.event.head_commit.message, 'ci skip')"
15+
strategy:
16+
matrix:
17+
runs-on: [ubuntu-20.04, ubuntu-22.04]
18+
swift-version: ["5.9", "5.9.2", "5.10"]
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set Ubuntu Release DOT
22+
run: echo "RELEASE_DOT=$(lsb_release -sr)" >> $GITHUB_ENV
23+
- name: Set Ubuntu Release NUM
24+
run: echo "RELEASE_NUM=${RELEASE_DOT//[-._]/}" >> $GITHUB_ENV
25+
- name: Set Ubuntu Codename
26+
run: echo "RELEASE_NAME=$(lsb_release -sc)" >> $GITHUB_ENV
27+
- name: Cache swift package modules
28+
id: cache-spm-linux
29+
uses: actions/cache@v4
30+
env:
31+
cache-name: cache-spm
32+
with:
33+
path: .build
34+
key: ${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-${{ matrix.swift-version }}-${{ hashFiles('Package.resolved') }}
35+
restore-keys: |
36+
${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-${{ matrix.swift-version }}-
37+
${{ runner.os }}-${{ env.RELEASE_DOT }}-${{ env.cache-name }}-
38+
- name: Cache swift
39+
id: cache-swift-linux
40+
uses: actions/cache@v4
41+
env:
42+
cache-name: cache-swift
43+
with:
44+
path: swift-${{ env.SWIFT_VER }}-RELEASE-ubuntu${{ env.RELEASE_DOT }}
45+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-${{ env.RELEASE_DOT }}
46+
restore-keys: |
47+
${{ runner.os }}-${{ env.cache-name }}-${{ matrix.swift-version }}-
48+
- name: Download Swift
49+
if: steps.cache-swift-linux.outputs.cache-hit != 'true'
50+
run: curl -O https://download.swift.org/swift-${SWIFT_VER}-release/ubuntu${RELEASE_NUM}/swift-${SWIFT_VER}-RELEASE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz
51+
- name: Extract Swift
52+
if: steps.cache-swift-linux.outputs.cache-hit != 'true'
53+
run: tar xzf swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}.tar.gz
54+
- name: Add Path
55+
run: echo "$GITHUB_WORKSPACE/swift-${SWIFT_VER}-RELEASE-ubuntu${RELEASE_DOT}/usr/bin" >> $GITHUB_PATH
56+
- name: Test
57+
run: swift test --enable-code-coverage
58+
- uses: sersoft-gmbh/swift-coverage-action@v4
59+
id: coverage-files
60+
with:
61+
fail-on-empty-output: true
62+
- name: Upload coverage to Codecov
63+
uses: codecov/codecov-action@v4
64+
with:
65+
fail_ci_if_error: true
66+
flags: swift-${{ matrix.swift-version }},ubuntu-${{ matrix.RELEASE_DOT }}
67+
verbose: true
68+
token: ${{ secrets.CODECOV_TOKEN }}
69+
files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
70+
build-macos:
71+
name: Build on macOS
72+
runs-on: ${{ matrix.os }}
73+
if: "!contains(github.event.head_commit.message, 'ci skip')"
74+
strategy:
75+
matrix:
76+
include:
77+
- xcode: "/Applications/Xcode_15.0.1.app"
78+
os: macos-13
79+
iOSVersion: "17.0.1"
80+
watchOSVersion: "10.0"
81+
watchName: "Apple Watch Series 9 (41mm)"
82+
iPhoneName: "iPhone 15"
83+
- xcode: "/Applications/Xcode_15.1.app"
84+
os: macos-13
85+
iOSVersion: "17.2"
86+
watchOSVersion: "10.2"
87+
watchName: "Apple Watch Series 9 (45mm)"
88+
iPhoneName: "iPhone 15 Plus"
89+
- xcode: "/Applications/Xcode_15.2.app"
90+
os: macos-14
91+
iOSVersion: "17.2"
92+
watchOSVersion: "10.2"
93+
watchName: "Apple Watch Ultra (49mm)"
94+
iPhoneName: "iPhone 15 Pro"
95+
- xcode: "/Applications/Xcode_15.3.app"
96+
os: macos-14
97+
iOSVersion: "17.4"
98+
watchOSVersion: "10.4"
99+
watchName: "Apple Watch Ultra 2 (49mm)"
100+
iPhoneName: "iPhone 15 Pro Max"
101+
steps:
102+
- uses: actions/checkout@v4
103+
- name: Cache swift package modules
104+
id: cache-spm-macos
105+
uses: actions/cache@v4
106+
env:
107+
cache-name: cache-spm
108+
with:
109+
path: .build
110+
key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-${{ hashFiles('Package.resolved') }}
111+
restore-keys: |
112+
${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-
113+
- name: Cache mint
114+
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
115+
id: cache-mint
116+
uses: actions/cache@v4
117+
env:
118+
cache-name: cache-mint
119+
with:
120+
path: .mint
121+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Mintfile') }}
122+
restore-keys: |
123+
${{ runner.os }}-build-${{ env.cache-name }}-
124+
${{ runner.os }}-build-
125+
${{ runner.os }}-
126+
- name: Set Xcode Name
127+
run: echo "XCODE_NAME=$(basename -- ${{ matrix.xcode }} | sed 's/\.[^.]*$//' | cut -d'_' -f2)" >> $GITHUB_ENV
128+
- name: Setup Xcode
129+
run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer
130+
- name: Install mint
131+
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
132+
run: |
133+
brew update
134+
brew install mint
135+
- name: Build
136+
run: swift build
137+
- name: Run Swift Package tests
138+
run: swift test --enable-code-coverage
139+
- uses: sersoft-gmbh/swift-coverage-action@v4
140+
id: coverage-files-spm
141+
with:
142+
fail-on-empty-output: true
143+
- name: Upload coverage reports to Codecov
144+
uses: codecov/codecov-action@v4
145+
with:
146+
files: ${{ join(fromJSON(steps.coverage-files-spm.outputs.files), ',') }}
147+
token: ${{ secrets.CODECOV_TOKEN }}
148+
flags: macOS,${{ env.XCODE_NAME }},${{ matrix.runs-on }}
149+
- name: Clean up spm build directory
150+
run: rm -rf .build
151+
- name: Lint
152+
run: ./scripts/lint.sh
153+
if: startsWith(matrix.xcode,'/Applications/Xcode_15.3')
154+
- name: Run iOS target tests
155+
run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk "iphonesimulator" -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
156+
- uses: sersoft-gmbh/swift-coverage-action@v4
157+
id: coverage-files-iOS
158+
with:
159+
fail-on-empty-output: true
160+
- name: Upload coverage to Codecov
161+
uses: codecov/codecov-action@v4
162+
with:
163+
fail_ci_if_error: true
164+
verbose: true
165+
token: ${{ secrets.CODECOV_TOKEN }}
166+
files: ${{ join(fromJSON(steps.coverage-files-iOS.outputs.files), ',') }}
167+
flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }}
168+
- name: Run watchOS target tests
169+
run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk "watchsimulator" -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test
170+
- uses: sersoft-gmbh/swift-coverage-action@v4
171+
id: coverage-files-watchOS
172+
with:
173+
fail-on-empty-output: true
174+
- name: Upload coverage to Codecov
175+
uses: codecov/codecov-action@v4
176+
with:
177+
fail_ci_if_error: true
178+
verbose: true
179+
token: ${{ secrets.CODECOV_TOKEN }}
180+
files: ${{ join(fromJSON(steps.coverage-files-watchOS.outputs.files), ',') }}
181+
flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }}
182+
build-self:
183+
name: Build on Self-Hosting macOS
184+
runs-on: [self-hosted, macOS]
185+
if: github.event.repository.owner.login == github.event.organization.login && !contains(github.event.head_commit.message, 'ci skip')
186+
steps:
187+
- uses: actions/checkout@v4
188+
- name: Cache swift package modules
189+
id: cache-spm-macos
190+
uses: actions/cache@v4
191+
env:
192+
cache-name: cache-spm
193+
with:
194+
path: .build
195+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Package.resolved') }}
196+
restore-keys: |
197+
${{ runner.os }}-build-${{ env.cache-name }}-
198+
${{ runner.os }}-build-
199+
${{ runner.os }}-
200+
- name: Cache mint
201+
id: cache-mint
202+
uses: actions/cache@v4
203+
env:
204+
cache-name: cache-mint
205+
with:
206+
path: .mint
207+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Mintfile') }}
208+
restore-keys: |
209+
${{ runner.os }}-build-${{ env.cache-name }}-
210+
${{ runner.os }}-build-
211+
${{ runner.os }}-
212+
- name: Build
213+
run: swift build
214+
- name: Run Swift Package tests
215+
run: swift test --enable-code-coverage
216+
- uses: sersoft-gmbh/swift-coverage-action@v4
217+
with:
218+
fail-on-empty-output: true
219+
- name: Upload coverage reports to Codecov
220+
uses: codecov/codecov-action@v4
221+
with:
222+
token: ${{ secrets.CODECOV_TOKEN }}
223+
flags: macOS,${{ env.XCODE_NAME }}
224+
- name: Clean up spm build directory
225+
run: rm -rf .build
226+
- name: Lint
227+
run: ./scripts/lint.sh

.gitignore

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/swift,swiftpm,swiftpackagemanager,xcode,macos
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=swift,swiftpm,swiftpackagemanager,xcode,macos
3+
4+
### macOS ###
5+
# General
6+
.DS_Store
7+
.AppleDouble
8+
.LSOverride
9+
10+
# Icon must end with two \r
11+
Icon
12+
13+
14+
# Thumbnails
15+
._*
16+
17+
# Files that might appear in the root of a volume
18+
.DocumentRevisions-V100
19+
.fseventsd
20+
.Spotlight-V100
21+
.TemporaryItems
22+
.Trashes
23+
.VolumeIcon.icns
24+
.com.apple.timemachine.donotpresent
25+
26+
# Directories potentially created on remote AFP share
27+
.AppleDB
28+
.AppleDesktop
29+
Network Trash Folder
30+
Temporary Items
31+
.apdisk
32+
33+
### macOS Patch ###
34+
# iCloud generated files
35+
*.icloud
36+
37+
### Swift ###
38+
# Xcode
39+
#
40+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
41+
42+
## User settings
43+
xcuserdata/
44+
45+
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
46+
*.xcscmblueprint
47+
*.xccheckout
48+
49+
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
50+
build/
51+
DerivedData/
52+
*.moved-aside
53+
*.pbxuser
54+
!default.pbxuser
55+
*.mode1v3
56+
!default.mode1v3
57+
*.mode2v3
58+
!default.mode2v3
59+
*.perspectivev3
60+
!default.perspectivev3
61+
62+
## Obj-C/Swift specific
63+
*.hmap
64+
65+
## App packaging
66+
*.ipa
67+
*.dSYM.zip
68+
*.dSYM
69+
70+
## Playgrounds
71+
timeline.xctimeline
72+
playground.xcworkspace
73+
74+
# Swift Package Manager
75+
#
76+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
77+
# Packages/
78+
# Package.pins
79+
# Package.resolved
80+
*.xcodeproj
81+
#
82+
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
83+
# hence it is not needed unless you have added a package configuration file to your project
84+
.swiftpm
85+
86+
.build/
87+
88+
# CocoaPods
89+
#
90+
# We recommend against adding the Pods directory to your .gitignore. However
91+
# you should judge for yourself, the pros and cons are mentioned at:
92+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
93+
#
94+
# Pods/
95+
#
96+
# Add this line if you want to avoid checking in source code from the Xcode workspace
97+
# *.xcworkspace
98+
99+
# Carthage
100+
#
101+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
102+
# Carthage/Checkouts
103+
104+
Carthage/Build/
105+
106+
# Accio dependency management
107+
Dependencies/
108+
.accio/
109+
110+
# fastlane
111+
#
112+
# It is recommended to not store the screenshots in the git repo.
113+
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
114+
# For more information about the recommended setup visit:
115+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
116+
117+
fastlane/report.xml
118+
fastlane/Preview.html
119+
fastlane/screenshots/**/*.png
120+
fastlane/test_output
121+
122+
# Code Injection
123+
#
124+
# After new code Injection tools there's a generated folder /iOSInjectionProject
125+
# https://github.com/johnno1962/injectionforxcode
126+
127+
iOSInjectionProject/
128+
129+
.mint
130+
Output

.hound.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
swiftlint:
2+
config_file: .swiftlint.yml

.periphery.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
retain_public: true
2+
index_exclude:
3+
- "Sources/**/Generated/*.swift"

.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: [AviaryInsights]

.swift-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.9

.swiftformat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--indent 2
2+
--header "\n .*?\.swift\n AviaryInsights\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"
3+
--commas inline
4+
--disable wrapMultilineStatementBraces, redundantInternal,redundantSelf,wrapMultilineStatementBraces,genericExtensions
5+
--extensionacl on-declarations
6+
--decimalgrouping 3,4
7+
--exclude .build, DerivedData, .swiftpm, Sources/AviaryInsights/Generated

0 commit comments

Comments
 (0)