Skip to content

Commit 12ac3d5

Browse files
committed
Adding Continuous Integration (#13)
1 parent 736aa28 commit 12ac3d5

File tree

2 files changed

+137
-2
lines changed

2 files changed

+137
-2
lines changed

.github/workflows/SyntaxKit.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: SyntaxKit
2+
on:
3+
push:
4+
branches-ignore:
5+
- '*WIP'
6+
env:
7+
PACKAGE_NAME: SyntaxKit
8+
jobs:
9+
build-ubuntu:
10+
name: Build on Ubuntu
11+
runs-on: ubuntu-latest
12+
container: swiftlang/swift:nightly-${{ matrix.swift-version }}-${{ matrix.os }}
13+
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
14+
strategy:
15+
matrix:
16+
os: ["noble", "jammy"]
17+
swift-version: ["6.1", "6.2"]
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: brightdigit/swift-build@v1.1.1
21+
- uses: sersoft-gmbh/swift-coverage-action@v4
22+
id: coverage-files
23+
with:
24+
fail-on-empty-output: true
25+
- name: Upload coverage to Codecov
26+
uses: codecov/codecov-action@v4
27+
with:
28+
fail_ci_if_error: true
29+
flags: swift-${{ matrix.swift-version }},ubuntu
30+
verbose: true
31+
token: ${{ secrets.CODECOV_TOKEN }}
32+
files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
33+
build-macos:
34+
name: Build on macOS
35+
env:
36+
PACKAGE_NAME: SyntaxKit
37+
runs-on: ${{ matrix.runs-on }}
38+
if: "!contains(github.event.head_commit.message, 'ci skip')"
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
include:
43+
# SPM Build Matrix
44+
- runs-on: macos-15
45+
xcode: "/Applications/Xcode_16.4.app"
46+
47+
# macOS Build Matrix
48+
- type: macos
49+
runs-on: macos-15
50+
xcode: "/Applications/Xcode_16.4.app"
51+
52+
# iOS Build Matrix
53+
- type: ios
54+
runs-on: macos-15
55+
xcode: "/Applications/Xcode_16.4.app"
56+
deviceName: "iPhone 16 Pro"
57+
osVersion: "18.5"
58+
59+
# watchOS Build Matrix
60+
- type: watchos
61+
runs-on: macos-15
62+
xcode: "/Applications/Xcode_16.4.app"
63+
deviceName: "Apple Watch Ultra 2 (49mm)"
64+
osVersion: "11.5"
65+
66+
# tvOS Build Matrix
67+
- type: tvos
68+
runs-on: macos-15
69+
xcode: "/Applications/Xcode_16.4.app"
70+
deviceName: "Apple TV"
71+
osVersion: "18.5"
72+
73+
# visionOS Build Matrix
74+
- type: visionos
75+
runs-on: macos-15
76+
xcode: "/Applications/Xcode_16.4.app"
77+
deviceName: "Apple Vision Pro"
78+
osVersion: "2.5"
79+
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- name: Build and Test
84+
uses: brightdigit/swift-build@v1.1.1
85+
with:
86+
scheme: ${{ env.PACKAGE_NAME }}-Package
87+
type: ${{ matrix.type }}
88+
xcode: ${{ matrix.xcode }}
89+
deviceName: ${{ matrix.deviceName }}
90+
osVersion: ${{ matrix.osVersion }}
91+
92+
# Common Coverage Steps
93+
- name: Process Coverage
94+
uses: sersoft-gmbh/swift-coverage-action@v4
95+
96+
- name: Upload Coverage
97+
uses: codecov/codecov-action@v4
98+
with:
99+
token: ${{ secrets.CODECOV_TOKEN }}
100+
flags: ${{ matrix.type && format('{0}{1}', matrix.type, matrix.osVersion) || 'spm' }}
101+
102+
# lint:
103+
# name: Linting
104+
# if: "!contains(github.event.head_commit.message, 'ci skip')"
105+
# runs-on: ubuntu-latest
106+
# needs: [build-ubuntu, build-macos]
107+
# env:
108+
# MINT_PATH: .mint/lib
109+
# MINT_LINK_PATH: .mint/bin
110+
# steps:
111+
# - uses: actions/checkout@v4
112+
# - name: Cache mint
113+
# id: cache-mint
114+
# uses: actions/cache@v4
115+
# env:
116+
# cache-name: cache
117+
# with:
118+
# path: |
119+
# .mint
120+
# Mint
121+
# key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
122+
# restore-keys: |
123+
# ${{ runner.os }}-mint-
124+
# - name: Install mint
125+
# if: steps.cache-mint.outputs.cache-hit != 'true'
126+
# run: |
127+
# git clone https://github.com/yonaskolb/Mint.git
128+
# cd Mint
129+
# swift run mint install yonaskolb/mint
130+
# - name: Lint
131+
# run: ./Scripts/lint.sh

Package.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// swift-tools-version: 6.2
1+
// swift-tools-version: 6.1
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "SyntaxKit",
88
platforms: [
9-
.macOS(.v13)
9+
.macOS(.v13),
10+
.iOS(.v13),
11+
.watchOS(.v6),
12+
.tvOS(.v13),
13+
.visionOS(.v1)
1014
],
1115
products: [
1216
// Products define the executables and libraries a package produces, making them visible to other packages.

0 commit comments

Comments
 (0)