Skip to content

Add GH action #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/run_linter_and_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run linter and unit tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:

runs-on: macos-12

steps:
- uses: actions/checkout@v3

- name: Set Xcode version
run: |
ls -l /Applications | grep 'Xcode'
sudo xcode-select -s /Applications/Xcode_14.0.1.app

- name: Lint code using SwiftLint
run: swiftlint --strict --reporter github-actions-logging

- name: Build iOS
run: |
xcodebuild -scheme YCoreUI -sdk iphonesimulator16.0 -destination 'platform=iOS Simulator,name=iPhone 14' build-for-testing

- name: Run tests iOS
run: |
xcodebuild -scheme YCoreUI -sdk iphonesimulator16.0 -destination 'platform=iOS Simulator,name=iPhone 14' test-without-building

- name: Build tvOS
run: |
xcodebuild -scheme YCoreUI -sdk appletvsimulator16.0 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation)' build-for-testing

- name: Run tests tvOS
run: |
xcodebuild -scheme YCoreUI -sdk appletvsimulator16.0 -destination 'platform=tvOS Simulator,name=Apple TV 4K (2nd generation)' test-without-building