Skip to content

Commit

Permalink
Feature/update workflows (#5)
Browse files Browse the repository at this point in the history
* Introduced .xcode-version

* Removed clean input

* Styling

* Removed unused branches

* Removed unused trigger

* Using default PR types

* Removed unnecessary files

* Updated .gitignore

* Resolving dependencies as a separate step

* Creating simulator from workflow
  • Loading branch information
AllDmeat authored Jun 20, 2023
1 parent 385158b commit 2bda9d5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 119 deletions.
11 changes: 5 additions & 6 deletions .github/actions/prepare_env_app_build/action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: 'Prepare Environment for App Build'

inputs:
xcode-version:
description: 'Xcode version'
required: true

runs:
using: "composite"

steps:
- name: Get Xcode Version
shell: 'zsh {0}'
run: echo "XCODE_VERSION=$(<.xcode-version)" >> $GITHUB_ENV

- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ inputs.xcode-version }}
xcode-version: ${{ env.XCODE_VERSION }}
36 changes: 22 additions & 14 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ name: Unit Tests

on:
pull_request:
types: [opened, edited, reopened, synchronize]
branches:
- 'develop'
- 'main'
- 'release/**'
- 'hotfix/**'
workflow_dispatch:

defaults:
run:
Expand All @@ -23,34 +18,47 @@ env:
LANGUAGE: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
SCHEME: "BlackBoxFirebasePerformance"
XCODE_VERSION: '~>14'

jobs:
unit-tests-spm:
runs-on: 'macos-latest'
runs-on: 'macos-13'

timeout-minutes: 15

strategy:
matrix:
DESTINATION: ["platform=iOS Simulator,name=iPhone 11", "platform=tvOS Simulator,name=Apple TV"]

steps:
- name: Get source code
uses: actions/checkout@v3
with:
clean: true

- name: Prepare Environment for App Build
uses: ./.github/actions/prepare_env_app_build
with:
xcode-version: ${{ env.XCODE_VERSION }}


- name: Resolve Dependencies
run: xcodebuild -resolvePackageDependencies

- name: Create Simulators
run: |
xcrun simctl delete all
xcrun simctl create "iPhone 11" com.apple.CoreSimulator.SimDeviceType.iPhone-11
xcrun simctl create "Apple TV" com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-3rd-generation-4K
- name: Build
run: xcodebuild build-for-testing -scheme ${{ env.SCHEME }} -destination '${{ matrix.DESTINATION }}'
run: >
xcodebuild build-for-testing
-scheme ${{ env.SCHEME }}
-destination '${{ matrix.DESTINATION }}'
-quiet
- name: Test
if: ${{ !contains(matrix.DESTINATION, 'watchOS') }} # watchOS Simulator is too slow on GitHub-hosted Runners, expectation-related tests are flaky
run: xcodebuild test -scheme ${{ env.SCHEME }} -destination '${{ matrix.DESTINATION }}'
run: >
xcodebuild test
-scheme ${{ env.SCHEME }}
-destination '${{ matrix.DESTINATION }}'
-quiet
# This allows us to have a branch protection rule for tests and deploys with matrix
status-for-matrix:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ playground.xcworkspace
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm
.swiftpm

.build/

Expand Down
7 changes: 0 additions & 7 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

This file was deleted.

91 changes: 0 additions & 91 deletions .swiftpm/xcode/xcshareddata/xcschemes/BlackBoxFirebase.xcscheme

This file was deleted.

1 change: 1 addition & 0 deletions .xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.2.0

0 comments on commit 2bda9d5

Please sign in to comment.