-if [ -f "$ARCHIVE_TOX_DIR/failed-envs.log" ]; then
- failed_envs=($(cat "$ARCHIVE_TOX_DIR/failed-envs.log"))
- echo "ERROR: Failed the following builds: ${failed_envs[*]}"
- exit 1
+echo "---> Completed tox runs"
+
+# Disable SC2116 as we want to echo a space separated list of TOX_ENVS
+# shellcheck disable=SC2116
+for i in .tox/*/log; do
+ tox_env=$(echo "$i" | awk -F'/' '{print $2}')
+ # defend against glob finding no matches
+ if ! cp -r "$i" "$ARCHIVE_TOX_DIR/$tox_env"; then
+ echo "WARN: no logs found to archive"
+ break
+ fi
+done
+
+# If docs are generated push them to archives.
+DOC_DIR="${DOC_DIR:-docs/_build/html}"
+if [[ -d $DOC_DIR ]]; then
+ echo "---> Archiving generated docs"
+ mv "$DOC_DIR" "$ARCHIVE_DOC_DIR"