Skip to content
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

test: build then test - unit test suites #3309

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e6c131c
test: build then test - unit test suites
atierian Oct 18, 2023
3dc9943
fix job name typo [skip ci]
atierian Oct 18, 2023
e810fbf
disable other unit test flow temporarily
atierian Oct 18, 2023
3156ac7
disable other runs on push (temp) and use steps for uses invokation
atierian Oct 18, 2023
714760d
add runs-on
atierian Oct 18, 2023
7a3335a
remove extra command that was hanging around
atierian Oct 18, 2023
94a14ed
add checkout step
atierian Oct 18, 2023
1a66beb
input -> inputs typo
atierian Oct 18, 2023
3d64355
tweak xcodebuild input and run only ios for now
atierian Oct 18, 2023
016916f
remove derivedData path from build-without-testing
atierian Oct 18, 2023
ba3a720
try remove derivedData path from build-for-testing job
atierian Oct 18, 2023
4f87a04
pull cache before test-without-building
atierian Oct 19, 2023
52b5d6b
fix build-for-testing job name
atierian Oct 19, 2023
486d154
disable automatic package resolution on test-without-building
atierian Oct 19, 2023
abc9efa
remove extra cache restores and drop scheme from key to isolate
atierian Oct 19, 2023
ca15a93
disable code coverage from test-without-building
atierian Oct 19, 2023
c59f344
remove restore-key from cache retrieval
atierian Oct 19, 2023
4b28a58
enable not enabled
atierian Oct 19, 2023
8b690ac
remove quotes around env vars
atierian Oct 19, 2023
297fe25
test-without-building with xctestrun and -only-testing flag
atierian Oct 20, 2023
e456b99
remove ls
atierian Oct 20, 2023
ee9dd2f
update restore path and specify only one target scheme
atierian Oct 20, 2023
b82b6ad
find type flag
atierian Oct 20, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'Run xcodebuild build-for-testing'
description: 'Action builds the specified scheme for testing'

inputs:
scheme:
required: true
type: string
sdk:
required: true
type: string
destination:
required: true
type: string
cloned_source_packages_path:
required: false
type: string
default: ''
derived_data_path:
required: true
type: string
disable_package_resolution:
required: false
type: boolean
default: false

runs:
using: "composite"
steps:
- name: Test ${{ inputs.scheme }}
env:
SCHEME: ${{ inputs.scheme }}
PROJECT_PATH: ${{ inputs.project_path }}
CLONED_SOURCE_PACKAGES_PATH: ${{ inputs.cloned_source_packages_path }}
DERIVED_DATA_PATH: ${{ inputs.derived_data_path }}
run: |
sudo xcode-select -s /Applications/Xcode_14.3.app

clonedSourcePackagesPath=""
if [ ! -z "$CLONED_SOURCE_PACKAGES_PATH" ]; then
echo "Using custom cloned source packages path"
clonedSourcePackagesPath+="-clonedSourcePackagesDirPath $CLONED_SOURCE_PACKAGES_PATH"
fi

if [ "${{ inputs.disable_package_resolution }}" == "true" ]; then
echo "Disabling Automatic Package Resolution"
clonedSourcePackagesPath+=" -disableAutomaticPackageResolution"
fi

xcode-select -p
xcodebuild -version
xcodebuild build-for-testing -scheme $SCHEME -sdk '${{ inputs.sdk }}' -destination '${{ inputs.destination }}' -derivedDataPath $DERIVED_DATA_PATH $clonedSourcePackagesPath | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
shell: bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Run xcodebuild test-without-building'
description: 'Action tests the specified scheme without building'

inputs:
scheme:
required: true
type: string
sdk:
required: true
type: string
destination:
required: true
type: string
derived_data_path:
required: true
type: string
generate_coverage:
required: true
type: boolean

runs:
using: "composite"
steps:
- name: Test ${{ inputs.scheme }}
env:
SCHEME: ${{ inputs.scheme }}
SDK: ${{ inputs.sdk }}
DESTINATION: ${{ inputs.destination }}
DERIVED_DATA_PATH: ${{ inputs.derived_data_path }}
run: |
sudo xcode-select -s /Applications/Xcode_14.3.app
xcode-select -p
xcodebuild -version
xcodebuild test-without-building -xctestrun $(find . -type f -name "*.xctestrun") -sdk $SDK -destination $DESTINATION -derivedDataPath $DERIVED_DATA_PATH -clonedSourcePackagesDirPath '~/Library/Developer/Xcode/DerivedData/Amplify' -disableAutomaticPackageResolution -enableCodeCoverage YES -only-testing:$SCHEME | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
shell: bash
1 change: 1 addition & 0 deletions .github/workflows/build_amplify_swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
branches-ignore:
- main
- release
- test-for-building

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/fortify_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
branches-ignore:
- main
- release
- test-for-building

permissions:
id-token: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
branches-ignore:
- main
- release
- test-for-building

permissions:
contents: read
Expand Down
Loading