Skip to content

Commit fb9a1cf

Browse files
committed
Add CI
1 parent da5bc6a commit fb9a1cf

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/swift.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Swift Build & Test
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
env:
11+
XCODE_SELECT_PATH: '/Applications/Xcode_16.4.app/Contents/Developer'
12+
13+
jobs:
14+
swift-build:
15+
name: Swift Build & Test
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [macos-15, ubuntu-22.04, ubuntu-24.04]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Set Xcode version
23+
if: ${{ matrix.os == 'macos-15' }}
24+
run: sudo xcode-select -s '${{ env.XCODE_SELECT_PATH }}'
25+
- name: Show Swift version
26+
run: swift --version
27+
- name: Show Swift Package Manager version
28+
run: swift package --version
29+
- uses: actions/checkout@v4
30+
- name: Build
31+
run: swift build -v | tee swift-build_${{ matrix.os }}.log && exit ${PIPESTATUS[0]}
32+
- name: Upload build log
33+
if: always()
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: swift build log (${{ matrix.os }})
37+
path: |
38+
swift-build_${{ matrix.os }}.log
39+
- name: Run tests
40+
run: swift test -v | tee swift-test_${{ matrix.os }}.log && exit ${PIPESTATUS[0]}
41+
- name: Upload test log
42+
if: always()
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: swift test log (${{ matrix.os }})
46+
path: |
47+
swift-test_${{ matrix.os }}.log

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Type definitions for App Store Connect webhook notification payloads in Swift.
66
![Swift: 6.1](https://img.shields.io/badge/Swift-6.1-orange.svg)
77
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/swiftlang/swift-package-manager) \
88
[![X (formerly Twitter): @treastrain](https://img.shields.io/twitter/follow/treastrain?label=%40treastrain&style=social)](https://x.com/treastrain)
9+
[![Swift Build & Test](https://github.com/treastrain/AppStoreConnectWebhook/actions/workflows/swift.yml/badge.svg)](https://github.com/treastrain/AppStoreConnectWebhook/actions/workflows/swift.yml)
910

1011
# How to add to your project
1112
## Package dependencies

0 commit comments

Comments
 (0)