Skip to content

chore(ci): added testing job for iOS #85

chore(ci): added testing job for iOS

chore(ci): added testing job for iOS #85

Workflow file for this run

name: Build, Lint & Test
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- # Setup testing
name: Enable development dependencies
run: |
sed -i.bak "s/\/\/dev//g" Package.swift
- # Build & Test
name: Build
run: swift build
- name: Run tests
run: swift test --enable-code-coverage
- # Generate and upload code coverage
name: Generate Code Coverage
run: |
xcrun llvm-cov export \
.build/debug/RainbowPackageTests.xctest/Contents/MacOS/RainbowPackageTests \
-instr-profile .build/debug/codecov/default.profdata \
--format="lcov" \
--ignore-filename-regex "\\.build" \
--ignore-filename-regex "Tests" > info.lcov
- name: Upload Code Coverage
run: |
bash <(curl -s https://codecov.io/bash) \
-J 'Rainbow' \
-G info.lcov
run-ios:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- # Setup testing
name: Enable development dependencies
run: |
sed -i.bak "s/\/\/dev//g" Package.swift
- # Install dependencies
run: brew install xcbeautify
- # Run Tests iOS
name: Run Tests iOS
run: |
set -o pipefail && \
env NSUnbufferedIO=YES \
xcodebuild -workspace . \
-scheme "Rainbow" \
-sdk iphonesimulator \
-destination "OS=17.2,name=iPhone 15 Pro" \
-configuration Debug \
CODE_SIGNING_ALLOWED="NO" \
test 2>&1 | tee test.log | xcbeautify
- name: Upload test log file on error
uses: actions/upload-artifact@v4
if: failure()
with:
name: test.log
path: test.log
swiftlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: SwiftLint
uses: norio-nomura/action-swiftlint@3.2.1