Skip to content

Commit 0962254

Browse files
committed
feat(binary): add skeletal Sources, Tests, and CodeQL workflow
1 parent b850a25 commit 0962254

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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"
13+
14+
on:
15+
push:
16+
branches-ignore:
17+
- '*WIP'
18+
pull_request:
19+
# The branches below must be a subset of the branches above
20+
branches: [ "main" ]
21+
schedule:
22+
- cron: '20 11 * * 3'
23+
24+
jobs:
25+
analyze:
26+
name: Analyze
27+
# Runner size impacts CodeQL analysis time. To learn more, please see:
28+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
29+
# - https://gh.io/supported-runners-and-hardware-resources
30+
# - https://gh.io/using-larger-runners
31+
# Consider using larger runners for possible analysis time improvements.
32+
runs-on: ${{ (matrix.language == 'swift' && 'macos-15') || 'ubuntu-latest' }}
33+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
34+
permissions:
35+
actions: read
36+
contents: read
37+
security-events: write
38+
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
language: [ 'swift' ]
43+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
44+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
45+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
46+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
52+
- name: Setup Xcode
53+
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
54+
55+
- name: Verify Swift Version
56+
run: |
57+
swift --version
58+
swift package --version
59+
60+
# Initializes the CodeQL tools for scanning.
61+
- name: Initialize CodeQL
62+
uses: github/codeql-action/init@v3
63+
with:
64+
languages: ${{ matrix.language }}
65+
# If you wish to specify custom queries, you can do so here or in a config file.
66+
# By default, queries listed here will override any specified in a config file.
67+
# Prefix the list here with "+" to use these queries and those in the config file.
68+
69+
# 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
70+
# queries: security-extended,security-and-quality
71+
72+
73+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
74+
# If this step fails, then you should remove it and run the build manually (see below)
75+
- run: |
76+
echo "Run, Build Application using script"
77+
swift build
78+
79+
- name: Perform CodeQL Analysis
80+
uses: github/codeql-action/analyze@v3
81+
with:
82+
category: "/language:${{matrix.language}}"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// SundialKitBinary provides modern binary serialization support for SundialKit.
2+
///
3+
/// This package extends SundialKit with efficient binary encoding and decoding
4+
/// for watch connectivity messages using modern Swift features.
5+
public enum SundialKitBinary {
6+
/// The version of SundialKitBinary
7+
public static let version = "1.0.0"
8+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Testing
2+
@testable import SundialKitBinary
3+
4+
@Suite("SundialKitBinary Tests")
5+
struct SundialKitBinaryTests {
6+
@Test("Version is defined")
7+
func versionIsDefined() {
8+
#expect(!SundialKitBinary.version.isEmpty)
9+
}
10+
}

0 commit comments

Comments
 (0)