Set test job as dependency for pod-lint #288
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD | |
on: | |
push: | |
branches: | |
- '*' | |
paths-ignore: | |
- 'website/**' | |
- 'README.md' | |
- 'LICENSE' | |
- 'CODE_OF_CONDUCT.md' | |
- 'CONTRIBUTING.md' | |
pull_request: | |
branches: | |
- 'master' | |
jobs: | |
danger-swiftlint: | |
name: Danger SwiftLint | |
runs-on: macos-15 | |
continue-on-error: true | |
if: github.event_name == 'pull_request' && github.event.action != 'synchronize' | |
env: | |
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install SwiftLint and Danger Swift | |
run: | | |
brew install swiftlint | |
brew install danger/tap/danger-swift | |
- name: Run Danger SwiftLint | |
run: danger-swift ci | |
pod-lint: | |
name: PodLint | |
needs: test | |
runs-on: macos-15 | |
if: github.event_name == 'pull_request' && github.event.action != 'synchronize' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install CocoaPods | |
working-directory: Example | |
run: pod install | |
- name: Lint pod library | |
run: pod lib lint --skip-tests --platforms=macos,ios,tvos --allow-warnings | |
spm-build: | |
name: Build Swift Package | |
runs-on: macos-15 | |
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.action != 'synchronize') | |
strategy: | |
matrix: | |
platform: [iOS, macOS, tvOS, watchOS] | |
include: | |
- platform: iOS | |
destination: 'platform=iOS Simulator,name=iPhone 16' | |
- platform: macOS | |
destination: 'platform=macOS' | |
- platform: tvOS | |
destination: 'platform=tvOS Simulator,name=Apple TV' | |
- platform: watchOS | |
destination: 'platform=watchOS Simulator,name=Apple Watch Ultra 2 (49mm)' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: 16.0 | |
- name: Install xcbeautify | |
run: brew install xcbeautify | |
- name: Build Package for ${{ matrix.platform }} | |
run: | | |
xcodebuild build -scheme CrowdinSDK -destination '${{ matrix.destination }}' | xcbeautify && exit ${PIPESTATUS[0]} | |
build: | |
name: Build | |
needs: spm-build | |
runs-on: macos-15 | |
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.action != 'synchronize') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install CocoaPods | |
working-directory: Example | |
run: pod install | |
- name: Install xcbeautify | |
run: brew install xcbeautify | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: 16.0 | |
- name: Build | |
working-directory: Example | |
run: | | |
xcodebuild build \ | |
-workspace ./AppleReminders.xcworkspace \ | |
-scheme AppleReminders \ | |
-configuration Debug \ | |
-destination 'platform=iOS Simulator,name=iPhone 16' | xcbeautify && exit ${PIPESTATUS[0]} | |
# TODO: ObjCExample | |
test: | |
name: Test | |
needs: build | |
runs-on: macos-15 | |
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.action != 'synchronize') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install CocoaPods | |
working-directory: Tests | |
run: pod install | |
- name: Install xcbeautify | |
run: brew install xcbeautify | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: 16.0 | |
- name: Tests | |
working-directory: Tests | |
run: | | |
xcodebuild test \ | |
-sdk iphonesimulator \ | |
-workspace ./Tests.xcworkspace \ | |
-scheme Tests \ | |
-configuration Debug \ | |
-destination 'platform=iOS Simulator,name=iPhone 16' \ | |
-enableCodeCoverage YES | xcbeautify && exit ${PIPESTATUS[0]} | |
- name: Upload coverage to Codecov | |
run: cd Tests & bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} |