index.html korjaus
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 20s
unit-tests Link to Bats reports
CI Feature / Bats tests (push) Successful in 1m24s
acc-tests Link to Cucumber reports
CI Feature / Cucumber tests (push) Successful in 51s
CI Feature / Report Summary (push) Successful in 5s
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 20s
unit-tests Link to Bats reports
CI Feature / Bats tests (push) Successful in 1m24s
acc-tests Link to Cucumber reports
CI Feature / Cucumber tests (push) Successful in 51s
CI Feature / Report Summary (push) Successful in 5s
This commit is contained in:
+10
-12
@@ -17,18 +17,16 @@ if [ ! -d "$REPORT_DIR" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$REPORT_DIR"
|
||||
|
||||
FILES=()
|
||||
while IFS= read -r -d '' f; do
|
||||
FILES+=("$(basename "$f")")
|
||||
done < <(find . -maxdepth 1 -type f ! -name index.html -print0 2>/dev/null || true)
|
||||
done < <(find "$REPORT_DIR" -maxdepth 1 -type f ! -name index.html -print0 2>/dev/null || true)
|
||||
|
||||
SUBDIRS=()
|
||||
while IFS= read -r -d '' d; do
|
||||
name="${d#./}"
|
||||
[ -f "$name/index.html" ] && SUBDIRS+=("$name")
|
||||
done < <(find . -maxdepth 1 -type d ! -name . -print0 2>/dev/null || true)
|
||||
name="${d#$REPORT_DIR/}"
|
||||
[ -f "$d/index.html" ] && SUBDIRS+=("$name")
|
||||
done < <(find "$REPORT_DIR" -maxdepth 1 -type d ! -name . -print0 2>/dev/null || true)
|
||||
|
||||
TOTAL=$(( ${#FILES[@]} + ${#SUBDIRS[@]} ))
|
||||
|
||||
@@ -61,26 +59,26 @@ generate_index() {
|
||||
html+="<li><a href=\"$d/index.html\">${d^}</a></li>"
|
||||
done
|
||||
html+='</ul></body></html>'
|
||||
printf '%s' "$html" > index.html
|
||||
printf '%s' "$html" > "$REPORT_DIR/index.html"
|
||||
}
|
||||
|
||||
cd - > /dev/null
|
||||
|
||||
# Stage reports for backward-compatible publish
|
||||
STAGED="reports/${SHA8}/${SUITE}"
|
||||
mkdir -p "$STAGED"
|
||||
cp -a "$REPORT_DIR/." "$STAGED/"
|
||||
|
||||
if [ "$TOTAL" -eq 1 ]; then
|
||||
cp -a "$REPORT_DIR/." "$STAGED/"
|
||||
bash .ci/scripts/publish-git-pages.sh "$SUITE"
|
||||
|
||||
if [ ${#FILES[@]} -eq 1 ]; then
|
||||
ENTRY="${FILES[0]}"
|
||||
else
|
||||
ENTRY="${SUBDIRS[0]}/index.html"
|
||||
fi
|
||||
bash .ci/scripts/publish-git-pages.sh "$SUITE"
|
||||
URL="${GIT_PAGES_URL}/${GITHUB_REPOSITORY}/reports/${SHA8}/${SUITE}/${ENTRY}"
|
||||
bash .ci/scripts/report-status.sh success "$DESCRIPTION" "$CONTEXT" "" "$URL"
|
||||
else
|
||||
generate_index
|
||||
cp -a "$REPORT_DIR/." "$STAGED/"
|
||||
bash .ci/scripts/publish-git-pages.sh "$SUITE"
|
||||
bash .ci/scripts/report-status.sh success "$DESCRIPTION" "$CONTEXT" "$SUITE"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user