Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/scripts/check-apps.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/bash

set -e
set -e # Exit immediately if any command fails

# Trim quotes in case any were introduced.
# # Clean up TARGETS: remove quotes and extra spaces
TARGETS=$(echo ${TARGETS} | tr -d '"' | awk '{$1=$1};1')

# Override the max runtime for specific apps. This is useful for apps
# that have a longer runtime on cold cache, but perform well when it's
# warm. Should add exceptions sparingly.
# List of apps that need custom max render times (slow on cold cache)
declare -A runtime_exceptions
runtime_exceptions["apps/cltlightrail"]="2s"
runtime_exceptions["apps/milbscores"]="15s"
Expand All @@ -20,21 +18,28 @@ runtime_exceptions["apps/ncaawstandings"]="5s"
runtime_exceptions["apps/nflstandings"]="5s"
runtime_exceptions["apps/nhlstandings"]="5s"

# If TARGETS is empty, nothing to check
if [ -z "${TARGETS}" ]; then
echo "✔️ No apps modified"
exit 0
fi

# Loop through each target app
for target in ${TARGETS}; do

# Skip if the app folder no longer exists (deleted)
if [[ ! -d "$target" ]]; then
# app was deleted
continue
fi

# If the app has a custom runtime exception, use it
if [ ${runtime_exceptions[$target]} ]; then
t=${runtime_exceptions[$target]}
echo "pixlet check --max-render-time ${t} ${target}"
pixlet check --max-render-time ${t} ${target}

# Otherwise use the default pixlet check
else
echo "pixlet check ${target}"
pixlet check ${target}
Expand Down
Loading