Skip to content

Commit 4e0ef31

Browse files
chore(standards): add CI (Swift/SwiftLint/Markdown/Links/CodeQL), Dependabot, templates, editors
1 parent 35f2d3e commit 4e0ef31

File tree

8 files changed

+126
-0
lines changed

8 files changed

+126
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.{yml,yaml,json,md}]
12+
indent_size = 2

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto eol=lf
2+
*.png binary
3+
*.jpg binary
4+
*.xcworkspace -text
5+
*.xcodeproj -text

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "swift"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/codeql.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CodeQL
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
schedule:
8+
- cron: '"0 3 * * 0"'
9+
jobs:
10+
analyze:
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
runs-on: macos-14
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: github/codeql-action/init@v3
19+
with:
20+
languages: swift
21+
- uses: github/codeql-action/analyze@v3

.github/workflows/markdownlint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Markdown Lint
2+
on:
3+
pull_request:
4+
paths: ["**/*.md"]
5+
push:
6+
paths: ["**/*.md"]
7+
jobs:
8+
markdownlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: DavidAnson/markdownlint-cli2-action@v17
13+
with:
14+
globs: |
15+
**/*.md

.github/workflows/swift-ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Swift CI
2+
on:
3+
pull_request:
4+
push:
5+
jobs:
6+
spm:
7+
if: ${{ hashFiles('Package.swift') != '' }}
8+
runs-on: macos-14
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: maxim-lobanov/setup-xcode@v1
12+
with:
13+
xcode-version: '15.4'
14+
- name: Build
15+
run: swift build -v
16+
- name: Test
17+
run: swift test --enable-code-coverage
18+
xcode:
19+
if: ${{ hashFiles('*.xcodeproj') != '' || hashFiles('*.xcworkspace') != '' }}
20+
runs-on: macos-14
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: maxim-lobanov/setup-xcode@v1
24+
with:
25+
xcode-version: '15.4'
26+
- name: Select scheme and build (generic platform)
27+
shell: bash
28+
run: |
29+
SCHEME=$(xcodebuild -list 2>/dev/null | awk '/Schemes:/{flag=1;next} flag && NF{print; exit}')
30+
if [ -n "$SCHEME" ]; then
31+
xcodebuild -scheme "$SCHEME" -configuration Release -destination 'generic/platform=iOS' build | xcpretty || true
32+
fi

.github/workflows/swiftlint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: SwiftLint
2+
on:
3+
pull_request:
4+
paths: ["**/*.swift", ".swiftlint.yml"]
5+
push:
6+
paths: ["**/*.swift", ".swiftlint.yml"]
7+
jobs:
8+
lint:
9+
runs-on: macos-14
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Install SwiftLint
13+
run: |
14+
brew update || true
15+
brew install swiftlint || true
16+
- name: Run SwiftLint
17+
run: swiftlint --strict

.swiftlint.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
disabled_rules:
2+
- trailing_whitespace
3+
- line_length
4+
- identifier_name
5+
- cyclomatic_complexity
6+
- function_body_length
7+
opt_in_rules:
8+
- empty_count
9+
- explicit_init
10+
- fatal_error_message
11+
included:
12+
- Sources
13+
- Tests
14+
reporter: "github-actions-logging"

0 commit comments

Comments
 (0)