Skip to content

Commit

Permalink
docker-ci: extract report-download-github as separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyCat committed Mar 10, 2024
1 parent 89f7d98 commit 8372f12
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 1 addition & 11 deletions docker-ci
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ EOF
docker images --filter='label=io.kaitai.ci=true'
}

# Downloads previous CI results from ci_artifacts repo
download_prev()
{
PREV_CI_FILE="ci_results/$TARGET$SUBTARGET/$IMPLEMENTATION-$OS-$ARCH/ci.json"
if [ ! -r "$PREV_CI_FILE" ]; then
mkdir -p $(dirname "$PREV_CI_FILE")
curl -sSL "https://raw.githubusercontent.com/kaitai-io/ci_artifacts/$TARGET$SUBTARGET/$IMPLEMENTATION-$OS-$ARCH/test_out/$TARGET$SUBTARGET/ci.json" -o "$PREV_CI_FILE"
fi
}

# Cleans up leftover binary artifacts from previous builds to make sure we're starting from scratch
cleanup_bin()
{
Expand Down Expand Up @@ -161,7 +151,7 @@ if [ -n "$GITHUB_ACTIONS" ]; then
fi

if [ "$DO_COMPARE_FLAG" = 1 ]; then
download_prev
./report-download-github "$TARGET" "$SUBTARGET" "$IMPLEMENTATION" "$OS" "$ARCH"
fi

if [ "$REBUILD_FLAG" = 1 ]; then
Expand Down
14 changes: 14 additions & 0 deletions report-download-github
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -ef
# Downloads previous CI results from ci_artifacts repo at GitHub

TARGET=$1
SUBTARGET=$2
IMPLEMENTATION=$3
OS=$4
ARCH=$5

PREV_CI_FILE="ci_results/$TARGET$SUBTARGET/$IMPLEMENTATION-$OS-$ARCH/ci.json"
if [ ! -r "$PREV_CI_FILE" ]; then
mkdir -p $(dirname "$PREV_CI_FILE")
curl -sSL "https://raw.githubusercontent.com/kaitai-io/ci_artifacts/$TARGET$SUBTARGET/$IMPLEMENTATION-$OS-$ARCH/test_out/$TARGET$SUBTARGET/ci.json" -o "$PREV_CI_FILE"
fi

0 comments on commit 8372f12

Please sign in to comment.