Skip to content

Swift CI

Swift CI #994

Workflow file for this run

name: Swift CI
on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ master ]
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.app/Contents/Developer
jobs:
test-ios:
runs-on: macos-latest
strategy:
matrix:
include:
- sdk: iphonesimulator15.2
destination: OS=15.2,name=iPhone 8
platform: iphone
- sdk: appletvsimulator15.2
destination: OS=15.2,name=Apple TV
platform: appletv
steps:
- uses: actions/checkout@v3
- name: Tests
run: |
set -o pipefail
xcodebuild build-for-testing -sdk ${{ matrix.sdk }} -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "${{ matrix.destination }}" CODE_SIGNING_REQUIRED=NO -quiet
xcodebuild test-without-building -sdk ${{ matrix.sdk }} -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "${{ matrix.destination }}" CODE_SIGNING_REQUIRED=NO -resultBundlePath tests/${{ matrix.platform }}.xcresult
- name: Archive results
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-results
path: tests
test-osx:
runs-on: macos-latest
strategy:
matrix:
include:
- sdk: macosx12.1
destination: arch=x86_64
platform: macos
steps:
- uses: actions/checkout@v3
- name: Tests
run: |
set -o pipefail
xcodebuild build-for-testing -sdk ${{ matrix.sdk }} -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "${{ matrix.destination }}" -quiet
xcodebuild test-without-building -sdk ${{ matrix.sdk }} -project ConfigCat.xcodeproj -scheme "ConfigCat" -destination "${{ matrix.destination }}" -resultBundlePath tests/${{ matrix.platform }}.xcresult
- name: Archive results
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-results
path: tests
coverage:
needs: [test-ios, test-osx]
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Slather
run: gem install slather
- name: Execute Coverage
run: |
set -o pipefail
xcodebuild build-for-testing -sdk macosx12.1 -project ConfigCat.xcodeproj -scheme "ConfigCat Coverage" -destination "arch=x86_64" -quiet
xcodebuild test-without-building -sdk macosx12.1 -project ConfigCat.xcodeproj -scheme "ConfigCat Coverage" -destination "arch=x86_64" -quiet
slather
bash <(curl -s https://codecov.io/bash) -f ./cobertura.xml
lint:
needs: coverage
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Cocoapods
run: gem install cocoapods
- name: Lint
run: pod lib lint
publish:
needs: lint
runs-on: macos-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- name: Install Cocoapods
run: gem install cocoapods
- name: Publish
run: pod trunk push
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}