Skip to content

Commit

Permalink
ci: Replace circleci with GH actions (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 authored Dec 13, 2023
1 parent ac5f18c commit 5d2912f
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 218 deletions.
197 changes: 0 additions & 197 deletions .circleci/config.yml

This file was deleted.

117 changes: 117 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Run CI
on:
push:
branches: [ main ]
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'

jobs:
macos-build:
runs-on: macos-latest

strategy:
matrix:
include:
- xcode-version: 15.0.0
ios-sim: 'platform=iOS Simulator,name=iPhone 15,OS=17.0.1'
- xcode-version: 14.0.1
ios-sim: 'platform=iOS Simulator,name=iPhone 14,OS=16.0'
- xcode-version: 13.4.1
ios-sim: 'platform=iOS Simulator,name=iPhone 11,OS=15.5'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # If you only need the current version keep this.

- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
if: ${{ matrix.xcode-version != '15.0.0' }}
with:
xcode-version: ${{ matrix.xcode-version }}

- name: Build & Test on macOS Simulator
run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk macosx -destination 'platform=macOS' | xcpretty

- name: Build for ARM64 macOS
run: xcodebuild build -scheme 'LDSwiftEventSource' -arch arm64e -sdk macosx | xcpretty

- name: Build Tests for iOS device
run: xcodebuild build-for-testing -scheme 'LDSwiftEventSource' -sdk iphoneos CODE_SIGN_IDENTITY= | xcpretty

- name: Build & Test on iOS Simulator
run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk iphonesimulator -destination '${{ matrix.ios-sim }}' CODE_SIGN_IDENTITY= | xcpretty

- name: Build Tests for tvOS device
run: xcodebuild build-for-testing -scheme 'LDSwiftEventSource' -sdk appletvos CODE_SIGN_IDENTITY= | xcpretty

- name: Build & Test on tvOS Simulator
run: xcodebuild test -scheme 'LDSwiftEventSource' -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty

- name: Build for watchOS simulator # No XCTest testing on watchOS
run: xcodebuild build -scheme 'LDSwiftEventSource' -sdk watchsimulator | xcpretty

- name: Build for watchOS device # No XCTest testing on watchOS
run: xcodebuild build -scheme 'LDSwiftEventSource' -sdk watchos | xcpretty

- name: Build & Test with swiftpm
run: swift test -v 2>&1 | xcpretty

- name: Run contract tests
run: make contract-tests

- name: Install jazzy gem
run: |
gem install jazzy
gem cleanup
- name: Build Documentation
run: jazzy -o artifacts/docs

- name: Validate coverage
run: |
FULLDOC=`jq '.warnings | length == 0' artifacts/docs/undocumented.json`
[ $FULLDOC == "true" ]
linux-build:
runs-on: ubuntu-latest

strategy:
matrix:
swift-version:
- 5.1
- 5.2
- 5.3
- 5.4
- 5.5
- 5.6
- 5.7
- 5.8
- 5.9

container: swift:${{ matrix.swift-version }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # If you only need the current version keep this.

- name: Build and test
run: swift test --enable-test-discovery

windows-build:
name: Windows - Swift 5.9
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Swift
uses: compnerd/gha-setup-swift@cd348eb89f2f450b0664c07fb1cb66880addf17d
with:
branch: swift-5.9-release
tag: 5.9-RELEASE
- name: Build and test
run: swift test
19 changes: 0 additions & 19 deletions .github/workflows/windows.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ start-contract-test-service-bg:

run-contract-tests:
curl -s https://raw.githubusercontent.com/launchdarkly/sse-contract-tests/main/downloader/run.sh \
| VERSION=v2 PARAMS="-url http://localhost:8000 -debug -stop-service-at-end -skip 'basic parsing/large message in two chunks'" sh
| 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

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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LDSwiftEventSource

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

0 comments on commit 5d2912f

Please sign in to comment.