Skip to content

Commit 89e3771

Browse files
Šimon Šestákclaude
andcommitted
ci: Add GitHub Actions workflows for automated testing and linting
Added 3 workflow files following FTNetworkTracer's modern pattern: - test.yml: Runs swift build and swift test on macOS for every push to main and all PRs - Path-filtered to run only when Swift files or package configuration changes - Uses actions/checkout@v4 (latest stable) - Verbose output for debugging - lint-swift.yml: Runs SwiftLint in strict mode on all PRs - Enforces code quality standards - Zero tolerance for warnings - Path-filtered for efficiency - lint-workflows.yml: Validates workflow files using actionlint - Catches workflow syntax errors and best practice violations - Includes problem matcher for IDE integration All workflows use path-based filtering for efficiency and follow Futured's established patterns from FTNetworkTracer and FTAPIKit repositories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 681c74d commit 89e3771

4 files changed

Lines changed: 109 additions & 0 deletions

File tree

.github/actionlint-matcher.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "actionlint",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)?:(?:\\x1b\\[\\d+m)?(\\d+)(?:\\x1b\\[\\d+m)?:(?:\\x1b\\[\\d+m)?(\\d+)(?:\\x1b\\[\\d+m)?: (?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)? \\[(.+?)\\]$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 4,
12+
"code": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/workflows/lint-swift.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint Swift
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
paths:
8+
- '**/*.swift'
9+
- 'Package.swift'
10+
- 'Package.resolved'
11+
- '.swiftlint.yml'
12+
- '.github/workflows/lint-swift.yml'
13+
14+
jobs:
15+
swiftlint:
16+
name: SwiftLint
17+
runs-on: macos-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install SwiftLint
23+
run: brew install swiftlint
24+
25+
- name: Run SwiftLint
26+
run: swiftlint lint --strict
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Lint Workflows
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
paths:
8+
- '.github/workflows/*.yml'
9+
- '.github/actionlint-matcher.json'
10+
11+
jobs:
12+
actionlint:
13+
name: actionlint
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 30
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Download actionlint
21+
id: get_actionlint
22+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
23+
shell: bash
24+
25+
- name: Register problem matcher
26+
run: echo "::add-matcher::.github/actionlint-matcher.json"
27+
28+
- name: Run actionlint
29+
run: ${{ steps.get_actionlint.outputs.executable }} -color
30+
shell: bash

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**/*.swift'
9+
- 'Package.swift'
10+
- 'Package.resolved'
11+
- '.github/workflows/test.yml'
12+
pull_request:
13+
branches:
14+
- '*'
15+
paths:
16+
- '**/*.swift'
17+
- 'Package.swift'
18+
- 'Package.resolved'
19+
- '.github/workflows/test.yml'
20+
21+
jobs:
22+
macos:
23+
name: macOS
24+
runs-on: macos-latest
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Swift version
30+
run: swift --version
31+
32+
- name: Build
33+
run: swift build -v
34+
35+
- name: Run tests
36+
run: swift test -v

0 commit comments

Comments
 (0)