Skip to content

Commit 5d2912f

Browse files
authored
ci: Replace circleci with GH actions (#71)
1 parent ac5f18c commit 5d2912f

File tree

5 files changed

+119
-218
lines changed

5 files changed

+119
-218
lines changed

.circleci/config.yml

-197
This file was deleted.

.github/workflows/ci.yml

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Run CI
2+
on:
3+
push:
4+
branches: [ main ]
5+
paths-ignore:
6+
- '**.md' # Do not need to run CI for markdown changes.
7+
pull_request:
8+
branches: [ main ]
9+
paths-ignore:
10+
- '**.md'
11+
12+
jobs:
13+
macos-build:
14+
runs-on: macos-latest
15+
16+
strategy:
17+
matrix:
18+
include:
19+
- xcode-version: 15.0.0
20+
ios-sim: 'platform=iOS Simulator,name=iPhone 15,OS=17.0.1'
21+
- xcode-version: 14.0.1
22+
ios-sim: 'platform=iOS Simulator,name=iPhone 14,OS=16.0'
23+
- xcode-version: 13.4.1
24+
ios-sim: 'platform=iOS Simulator,name=iPhone 11,OS=15.5'
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # If you only need the current version keep this.
30+
31+
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
32+
if: ${{ matrix.xcode-version != '15.0.0' }}
33+
with:
34+
xcode-version: ${{ matrix.xcode-version }}
35+
36+
- name: Build & Test on macOS Simulator
37+
run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk macosx -destination 'platform=macOS' | xcpretty
38+
39+
- name: Build for ARM64 macOS
40+
run: xcodebuild build -scheme 'LDSwiftEventSource' -arch arm64e -sdk macosx | xcpretty
41+
42+
- name: Build Tests for iOS device
43+
run: xcodebuild build-for-testing -scheme 'LDSwiftEventSource' -sdk iphoneos CODE_SIGN_IDENTITY= | xcpretty
44+
45+
- name: Build & Test on iOS Simulator
46+
run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk iphonesimulator -destination '${{ matrix.ios-sim }}' CODE_SIGN_IDENTITY= | xcpretty
47+
48+
- name: Build Tests for tvOS device
49+
run: xcodebuild build-for-testing -scheme 'LDSwiftEventSource' -sdk appletvos CODE_SIGN_IDENTITY= | xcpretty
50+
51+
- name: Build & Test on tvOS Simulator
52+
run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty
53+
54+
- name: Build for watchOS simulator # No XCTest testing on watchOS
55+
run: xcodebuild build -scheme 'LDSwiftEventSource' -sdk watchsimulator | xcpretty
56+
57+
- name: Build for watchOS device # No XCTest testing on watchOS
58+
run: xcodebuild build -scheme 'LDSwiftEventSource' -sdk watchos | xcpretty
59+
60+
- name: Build & Test with swiftpm
61+
run: swift test -v 2>&1 | xcpretty
62+
63+
- name: Run contract tests
64+
run: make contract-tests
65+
66+
- name: Install jazzy gem
67+
run: |
68+
gem install jazzy
69+
gem cleanup
70+
71+
- name: Build Documentation
72+
run: jazzy -o artifacts/docs
73+
74+
- name: Validate coverage
75+
run: |
76+
FULLDOC=`jq '.warnings | length == 0' artifacts/docs/undocumented.json`
77+
[ $FULLDOC == "true" ]
78+
79+
80+
linux-build:
81+
runs-on: ubuntu-latest
82+
83+
strategy:
84+
matrix:
85+
swift-version:
86+
- 5.1
87+
- 5.2
88+
- 5.3
89+
- 5.4
90+
- 5.5
91+
- 5.6
92+
- 5.7
93+
- 5.8
94+
- 5.9
95+
96+
container: swift:${{ matrix.swift-version }}
97+
98+
steps:
99+
- uses: actions/checkout@v3
100+
with:
101+
fetch-depth: 0 # If you only need the current version keep this.
102+
103+
- name: Build and test
104+
run: swift test --enable-test-discovery
105+
106+
windows-build:
107+
name: Windows - Swift 5.9
108+
runs-on: windows-latest
109+
steps:
110+
- uses: actions/checkout@v3
111+
- name: Install Swift
112+
uses: compnerd/gha-setup-swift@cd348eb89f2f450b0664c07fb1cb66880addf17d
113+
with:
114+
branch: swift-5.9-release
115+
tag: 5.9-RELEASE
116+
- name: Build and test
117+
run: swift test

.github/workflows/windows.yml

-19
This file was deleted.

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ start-contract-test-service-bg:
2121

2222
run-contract-tests:
2323
curl -s https://raw.githubusercontent.com/launchdarkly/sse-contract-tests/main/downloader/run.sh \
24-
| VERSION=v2 PARAMS="-url http://localhost:8000 -debug -stop-service-at-end -skip 'basic parsing/large message in two chunks'" sh
24+
| VERSION=v2 PARAMS="-url http://localhost:8000 -debug -stop-service-at-end -skip 'basic parsing/large message in one chunk' -skip 'basic parsing/large message in two chunks'" sh
2525

2626
contract-tests: build-contract-tests start-contract-test-service-bg run-contract-tests
2727

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LDSwiftEventSource
22

3-
[![CircleCI](https://circleci.com/gh/launchdarkly/swift-eventsource.svg?style=shield)](https://circleci.com/gh/launchdarkly/swift-eventsource)
3+
[![Run CI](https://github.com/launchdarkly/swift-eventsource/actions/workflows/ci.yml/badge.svg)](https://github.com/launchdarkly/swift-eventsource/actions/workflows/ci.yml)
44
[![CocoaPods](https://img.shields.io/cocoapods/v/LDSwiftEventSource.svg)](https://cocoapods.org/pods/LDSwiftEventSource)
55
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
66
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-4BC51D.svg?style=flat)](https://swift.org/package-manager/)

0 commit comments

Comments
 (0)