mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Add push-triggered personal E2E workflow
* Add push-triggered personal E2E workflow
This commit is contained in:
parent
adcbb36df8
commit
d2f0827bd1
1 changed files with 70 additions and 0 deletions
70
ci/e2e/run.sh
Normal file
70
ci/e2e/run.sh
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Required environment variables:
|
||||
# ONEDRIVE_BIN
|
||||
# E2E_TARGET
|
||||
# RUN_ID
|
||||
|
||||
OUT_DIR="ci/e2e/out"
|
||||
SYNC_ROOT="$RUNNER_TEMP/sync-${E2E_TARGET}"
|
||||
|
||||
mkdir -p "$OUT_DIR"
|
||||
mkdir -p "$SYNC_ROOT"
|
||||
|
||||
RESULTS_FILE="${OUT_DIR}/results.json"
|
||||
LOG_FILE="${OUT_DIR}/sync.log"
|
||||
|
||||
echo "E2E target: ${E2E_TARGET}"
|
||||
echo "Sync root: ${SYNC_ROOT}"
|
||||
|
||||
CASE_NAME="basic-resync"
|
||||
|
||||
pass_count=0
|
||||
fail_count=0
|
||||
|
||||
echo "Running: onedrive --sync --verbose --resync --resync-auth"
|
||||
|
||||
set +e
|
||||
"$ONEDRIVE_BIN" \
|
||||
--sync \
|
||||
--verbose \
|
||||
--resync \
|
||||
--resync-auth \
|
||||
--syncdir "$SYNC_ROOT" \
|
||||
> "$LOG_FILE" 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
|
||||
if [ "$rc" -eq 0 ]; then
|
||||
pass_count=1
|
||||
status="pass"
|
||||
else
|
||||
fail_count=1
|
||||
status="fail"
|
||||
fi
|
||||
|
||||
# Write minimal results.json
|
||||
cat > "$RESULTS_FILE" <<EOF
|
||||
{
|
||||
"target": "${E2E_TARGET}",
|
||||
"run_id": ${RUN_ID},
|
||||
"cases": [
|
||||
{
|
||||
"name": "${CASE_NAME}",
|
||||
"status": "${status}"
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "Exit code: ${rc}"
|
||||
echo "Results written to ${RESULTS_FILE}"
|
||||
echo "Passed: ${pass_count}"
|
||||
echo "Failed: ${fail_count}"
|
||||
|
||||
# Fail job if command failed
|
||||
if [ "$rc" -ne 0 ]; then
|
||||
echo "E2E failed - see sync.log"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue