Skip to content

Commit

Permalink
chore: Adding platform filter for unit tests workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ruisebas committed Nov 2, 2023
1 parent 97b9359 commit 28545c5
Show file tree
Hide file tree
Showing 16 changed files with 259 additions and 30 deletions.
12 changes: 1 addition & 11 deletions .github/composite_actions/run_xcodebuild/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ inputs:
required: false
type: boolean
default: false
build_for_testing:
type: boolean
required: false
default: false
other_flags:
required: false
type: string
Expand Down Expand Up @@ -74,12 +70,6 @@ runs:
otherFlags+=" -clonedSourcePackagesDirPath $CLONED_SOURCE_PACKAGES_PATH"
fi
action="build"
if [ "${{ inputs.build_for_testing }}" == "true" ]; then
echo "Building for testing..."
action+="-for-testing"
fi
xcodebuild -version
xcodebuild $action -scheme $SCHEME -sdk '${{ inputs.sdk }}' -destination '${{ inputs.destination }}' $otherFlags | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
xcodebuild build -scheme $SCHEME -sdk '${{ inputs.sdk }}' -destination '${{ inputs.destination }}' $otherFlags | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
shell: bash
8 changes: 4 additions & 4 deletions .github/workflows/build_amplify_swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ jobs:
path: ~/Library/Developer/Xcode/DerivedData/Amplify
key: ${{ steps.dependencies-cache.outputs.cache-primary-key }}

- name: Delete the old build cache on main
if: steps.build-cache.outputs.cache-hit # && github.ref_name == 'main'
- name: Delete the old build cache
if: steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
env:
GH_TOKEN: ${{ github.token }}
continue-on-error: true
run: |
gh cache delete ${{ steps.build-cache.outputs.cache-primary-key }}
- name: Save the build cache in the main
#if: github.ref_name == 'main'
- name: Save the build cache
if: github.ref_name == 'main'
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ${{ github.workspace }}/Build
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ on:

permissions:
contents: read
actions: write

jobs:
unit-tests:
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/run_unit_tests_platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@ on:
required: false
type: boolean
default: false
retry_on_error:
description: 'Whether to automatically retry if the tests fail'
required: false
type: boolean
default: true
other_flags:
required: false
type: string
default: ''

env:
SCHEME: ${{ inputs.scheme }}
RETRY_ON_ERROR: ${{ inputs.retry_on_error }}

permissions:
contents: read
Expand All @@ -51,4 +38,5 @@ jobs:
scheme: ${{ inputs.scheme }}
platform: ${{ matrix.platform }}
xcode_version: '14.3'
generate_coverage_report: ${{ matrix.platform == 'iOS' && inputs.generate_coverage_report }}
generate_coverage_report: ${{ github.event_name != 'workflow_dispatch' && matrix.platform == 'iOS' && inputs.generate_coverage_report }}
timeout-minutes: ${{ inputs.timeout-minutes }}
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_amplify.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | Amplify
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_analytics.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | Analytics
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_api.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | API
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_auth.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | Auth
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_core.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | Core
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_datastore.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | DataStore
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_geo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | Geo
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_internal_pinpoint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | Internal Pinpoint
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_logging.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | Logging
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_predictions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | Predictions
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit_test_push_notifications.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
name: Unit Tests | Push Notifications
on:
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean

permissions:
contents: read
Expand Down
Loading

0 comments on commit 28545c5

Please sign in to comment.