2020-05-13 01:55:42 +08:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
2021-01-02 19:28:57 +08:00
|
|
|
paths:
|
|
|
|
- .github/workflows/ci.yml
|
|
|
|
- .swiftlint.yml
|
|
|
|
- "**/*.swift"
|
2020-05-13 01:55:42 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
2020-12-30 20:53:49 +08:00
|
|
|
runs-on: macos-latest
|
2020-05-13 01:55:42 +08:00
|
|
|
|
2020-12-30 21:12:36 +08:00
|
|
|
name: "Lint"
|
|
|
|
|
2020-05-13 01:55:42 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2020-12-30 20:53:49 +08:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Run SwiftLint
|
|
|
|
run: |
|
|
|
|
swiftlint lint --strict --reporter github-actions-logging
|
2020-05-13 01:55:42 +08:00
|
|
|
|
|
|
|
test:
|
2020-12-30 20:53:49 +08:00
|
|
|
runs-on: macos-latest
|
2020-05-13 01:55:42 +08:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2020-12-30 21:12:36 +08:00
|
|
|
- os: macOS
|
2020-05-13 01:55:42 +08:00
|
|
|
destination: platform=macOS
|
2020-12-30 21:12:36 +08:00
|
|
|
- os: iOS
|
2020-05-13 01:55:42 +08:00
|
|
|
destination: platform=iOS Simulator,name=iPhone 11
|
2020-12-30 21:12:36 +08:00
|
|
|
- os: tvOS
|
2020-05-13 01:55:42 +08:00
|
|
|
destination: platform=tvOS Simulator,name=Apple TV 4K
|
2020-12-30 21:12:36 +08:00
|
|
|
- os: watchOS
|
2020-05-13 01:55:42 +08:00
|
|
|
destination: platform=watchOS Simulator,name=Apple Watch Series 5 - 44mm
|
|
|
|
|
2020-12-30 21:12:36 +08:00
|
|
|
name: "Test ${{ matrix.os }}"
|
|
|
|
|
2020-05-13 01:55:42 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2020-12-30 20:53:49 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-05-13 01:55:42 +08:00
|
|
|
- name: Build
|
2020-12-30 21:12:36 +08:00
|
|
|
run: xcodebuild build -workspace Surge.xcworkspace -scheme 'Surge-${{ matrix.os }}' -destination '${{ matrix.destination }}'
|
2020-05-13 01:55:42 +08:00
|
|
|
- name: Test
|
2020-12-30 21:12:36 +08:00
|
|
|
run: xcodebuild test -workspace Surge.xcworkspace -scheme 'Surge-${{ matrix.os }}' -destination '${{ matrix.destination }}'
|
|
|
|
if: matrix.os != 'watchOS'
|
2020-05-13 01:55:42 +08:00
|
|
|
|
|
|
|
benchmark:
|
|
|
|
needs: test
|
2020-12-30 20:53:49 +08:00
|
|
|
runs-on: macos-latest
|
2020-05-13 01:55:42 +08:00
|
|
|
|
2020-12-30 21:12:36 +08:00
|
|
|
name: "Benchmark"
|
|
|
|
|
2020-05-13 01:55:42 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2020-12-30 20:53:49 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-05-13 01:55:42 +08:00
|
|
|
- name: Run Benchmark Target
|
|
|
|
run: xcodebuild test -workspace Surge.xcworkspace -scheme SurgeBenchmarkTests-macOS -destination platform='macOS'
|