-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.1.2' into main
- Loading branch information
Showing
79 changed files
with
2,748 additions
and
5,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Unit testing and collect result infomations | ||
|
||
on: | ||
pull_request: | ||
types: [synchronize] | ||
|
||
concurrency: | ||
group: unit-test-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: macOS-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Select Xcode | ||
run: sudo xcode-select -s '/Applications/Xcode.app/Contents/Developer' | ||
|
||
- name: Prepare test | ||
run: | | ||
cd ./Scripts | ||
ROOT_PATH="../" | ||
ROOT_DIR_NAME=$(basename "$(cd "$ROOT_PATH" && pwd)") | ||
if [ "$ROOT_DIR_NAME" != "Aespa" ]; then | ||
echo "❌ Error: Script's not called in proper path." | ||
exit 1 | ||
fi | ||
# Generate mocks | ||
chmod +x ./gen-mocks.sh | ||
./gen-mocks.sh | ||
- name: Test | ||
run: | | ||
ROOT_PATH="./" | ||
# Now do test | ||
DERIVED_DATA_PATH="./DerivedData" | ||
PROJECT_NAME="TestHostApp" | ||
TEST_SCHEME="Test" | ||
xcodebuild test \ | ||
-verbose \ | ||
-project ${ROOT_PATH}/Tests/${PROJECT_NAME}.xcodeproj \ | ||
-scheme ${TEST_SCHEME} \ | ||
-destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=latest' \ | ||
-derivedDataPath ${DERIVED_DATA_PATH} \ | ||
-enableCodeCoverage YES \ | ||
| xcpretty --color \ | ||
|| exit 1 | ||
# Check if the tests failed | ||
if [ $? -ne 0 ]; then | ||
echo "❌ Error: Tests failed." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
disabled_rules: | ||
- colon | ||
- comma | ||
- control_statement | ||
- trailing_whitespace | ||
- nesting | ||
- type_body_length | ||
- file_length | ||
- no_fallthrough_only | ||
|
||
opt_in_rules: | ||
- missing_docs | ||
|
||
analyzer_rules: | ||
- explicit_self | ||
|
||
included: | ||
- Sources/* | ||
excluded: | ||
- Tests/* | ||
|
||
# If true, SwiftLint will not fail if no lintable files are found. | ||
allow_zero_lintable_files: false | ||
|
||
force_cast: warning # implicitly | ||
force_try: | ||
severity: warning # explicitly | ||
# implicitly | ||
line_length: 120 | ||
|
||
type_name: | ||
max_length: # warning and error | ||
warning: 40 | ||
error: 50 | ||
allowed_symbols: ["_"] | ||
|
||
identifier_name: | ||
allowed_symbols: ["_"] | ||
|
||
missing_docs: | ||
included: Sources/* | ||
|
||
reporter: "xcode" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
ROOT_PATH="../" | ||
ROOT_DIR_NAME=$(basename "$(cd "$ROOT_PATH" && pwd)") | ||
if [ "$ROOT_DIR_NAME" != "Aespa" ]; then | ||
echo "❌ Error: Script's not called in proper path." | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f run ]; then | ||
curl -Lo run https://raw.githubusercontent.com/Brightify/Cuckoo/master/run && chmod +x run | ||
fi | ||
|
||
PROJECT_NAME="Aespa" | ||
TESTER_NAME="TestHostApp" | ||
PACKAGE_SOURCE_PATH="${ROOT_PATH}/Sources/Aespa" | ||
OUTPUT_FILE="${ROOT_PATH}/Tests/Tests/Mock/GeneratedMocks.swift" | ||
SWIFT_FILES=$(find "$PACKAGE_SOURCE_PATH" -type f -name "*.swift" -print0 | xargs -0) | ||
|
||
echo "✅ Generated Mocks File = ${OUTPUT_FILE}" | ||
echo "✅ Mocks Input Directory = ${PACKAGE_SOURCE_PATH}" | ||
|
||
./run --download generate --testable "${PROJECT_NAME}" --output "${OUTPUT_FILE}" ${SWIFT_FILES} | ||
|
||
# Check the exit status of the last command | ||
if [ $? -ne 0 ]; then | ||
echo "❌ Error: Failed to generate mocks." | ||
exit 1 | ||
fi | ||
|
||
echo "✅ Generating mock was successful" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.