Skip to content

Commit 6133516

Browse files
authored
Merge pull request #6 from diogot/ci-improvements
Add CI caching and concurrency improvements
2 parents 9008f38 + e880f95 commit 6133516

File tree

4 files changed

+50
-49
lines changed

4 files changed

+50
-49
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,27 @@ on:
55
tags:
66
- 'v*'
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
test:
1014
name: Test Release
1115
runs-on: macos-26
1216
steps:
1317
- name: Checkout code
1418
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Cache Swift packages
23+
uses: actions/cache@v4
24+
with:
25+
path: .build
26+
key: spm-${{ runner.os }}-${{ hashFiles('Package.swift') }}
27+
restore-keys: |
28+
spm-${{ runner.os }}-
1529
1630
- name: Check Swift version
1731
run: swift --version
@@ -31,15 +45,31 @@ jobs:
3145
steps:
3246
- name: Checkout code
3347
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
3450

3551
- name: Get version from tag
3652
id: get_version
3753
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
3854

3955
- name: Generate release notes
40-
id: release_notes
4156
run: |
42-
cat > release_notes.md << 'EOF'
57+
# Get previous tag for changelog
58+
PREV_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | sed -n '2p')
59+
60+
# Generate changelog
61+
echo "## What's Changed" > release_notes.md
62+
echo "" >> release_notes.md
63+
if [ -z "$PREV_TAG" ]; then
64+
git log --pretty=format:"- %s" HEAD >> release_notes.md
65+
else
66+
git log --pretty=format:"- %s" ${PREV_TAG}..HEAD >> release_notes.md
67+
fi
68+
echo "" >> release_notes.md
69+
echo "" >> release_notes.md
70+
71+
# Append static content
72+
cat >> release_notes.md << 'EOF'
4373
## Installation
4474
4575
### Swift Package Manager
@@ -58,40 +88,12 @@ jobs:
5888
.target(name: "YourTarget", dependencies: ["XCResultParser"])
5989
```
6090
61-
## Features
62-
63-
- 📦 Parse Xcode `.xcresult` bundles
64-
- ⚠️ Extract build warnings, errors, and analyzer warnings
65-
- 🧪 Extract test failures with source locations
66-
- 🔄 Type-safe Swift models with resilient decoding
67-
- ⚡ Async/await support with Swift concurrency
68-
- 🛡️ Zero external dependencies
69-
7091
## Requirements
7192
7293
- Swift 6.2+
7394
- macOS 15+
7495
- Xcode 16+
7596
76-
## Usage
77-
78-
```swift
79-
import XCResultParser
80-
81-
let parser = XCResultParser(path: "path/to/test.xcresult")
82-
let result = try await parser.parse()
83-
84-
// Access build issues
85-
for issue in result.buildResults?.allIssues ?? [] {
86-
print("\(issue.severity): \(issue.message)")
87-
}
88-
89-
// Access test failures
90-
for failure in result.testResults?.failures ?? [] {
91-
print("FAIL: \(failure.testClass).\(failure.testName)")
92-
}
93-
```
94-
9597
For more information, see the [README](https://github.com/${{ github.repository }}/blob/main/README.md).
9698
EOF
9799

.github/workflows/test.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Tests
2+
23
on:
34
push:
45
branches:
@@ -7,11 +8,26 @@ on:
78
branches:
89
- main
910

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1015
jobs:
1116
test:
1217
runs-on: macos-26
1318
steps:
14-
- uses: actions/checkout@v4
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Cache Swift packages
25+
uses: actions/cache@v4
26+
with:
27+
path: .build
28+
key: spm-${{ runner.os }}-${{ hashFiles('Package.swift') }}
29+
restore-keys: |
30+
spm-${{ runner.os }}-
1531
1632
- name: Check Swift version
1733
run: swift --version

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ playground.xcworkspace
3030
# .swiftpm
3131

3232
.build/
33+
.swiftpm/
3334

3435
# CocoaPods
3536
#

CHANGELOG.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)