-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci-run-tests.sh
More file actions
executable file
·39 lines (33 loc) · 1.08 KB
/
Copy pathci-run-tests.sh
File metadata and controls
executable file
·39 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
set -euo pipefail
# Simple CI runner for macOS unit tests
# - Uses the CI scheme with code coverage enabled
# - Emits an .xcresult bundle and optional JUnit via xcpretty
SCHEME=${SCHEME:-singularity-CI}
DEST=${DEST:-"platform=macOS"}
# Use absolute path so downstream steps (Codecov) can reliably find it
RESULT_BUNDLE_PATH=${RESULT_BUNDLE_PATH:-"${GITHUB_WORKSPACE:-$PWD}/build/TestResults.xcresult"}
mkdir -p "$(dirname "$RESULT_BUNDLE_PATH")"
COMMON_FLAGS=(
CODE_SIGNING_ALLOWED=NO
CODE_SIGNING_REQUIRED=NO
CODE_SIGN_IDENTITY=-
)
if command -v xcpretty >/dev/null 2>&1; then
set -o pipefail
xcodebuild \
-scheme "$SCHEME" \
-destination "$DEST" \
-resultBundlePath "$RESULT_BUNDLE_PATH" \
"${COMMON_FLAGS[@]}" \
test | xcpretty -r junit -o build/junit.xml
else
xcodebuild \
-scheme "$SCHEME" \
-destination "$DEST" \
-resultBundlePath "$RESULT_BUNDLE_PATH" \
"${COMMON_FLAGS[@]}" \
test
fi
echo "Tests finished. Result bundle: $RESULT_BUNDLE_PATH"
if [[ -f build/junit.xml ]]; then echo "JUnit report: build/junit.xml"; fi