Skip to content

Commit

Permalink
Fix missing runtime for toolchain cache hits
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed Oct 16, 2024
1 parent 7b6ba44 commit 2db553c
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 101 deletions.
15 changes: 15 additions & 0 deletions .github/scripts/get-cache-keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

source `dirname ${BASH_SOURCE[0]}`/config.sh

WORKFLOW_SHA=$($ROOT_PATH/.github/scripts/get-files-sha.sh $ROOT_PATH $ROOT_PATH/.github/workflows/advanced.yml)
BINUTILS_SHA=$($ROOT_PATH/.github/scripts/get-repository-sha.sh $BINUTILS_REPO $BINUTILS_BRANCH)
GCC_SHA=$($ROOT_PATH/.github/scripts/get-repository-sha.sh $GCC_REPO $GCC_BRANCH)
MINGW_SHA=$($ROOT_PATH/.github/scripts/get-repository-sha.sh $MINGW_REPO $MINGW_BRANCH)
BINUTILS_SCRIPTS_SHA=$($ROOT_PATH/.github/scripts/get-files-sha.sh $ROOT_PATH $ROOT_PATH/.github/scripts/binutils)
TOOLCHAIN_SCRIPTS_SHA=$($ROOT_PATH/.github/scripts/get-files-sha.sh $ROOT_PATH $ROOT_PATH/.github/scripts/toolchain)

echo "toolchain-cache-key=$TOOLCHAIN_NAME-toolchain-$WORKFLOW_SHA-$BINUTILS_SHA-$GCC_SHA-$MINGW_SHA-$BINUTILS_SCRIPTS_SHA-$TOOLCHAIN_SCRIPTS_SHA" >> "$GITHUB_OUTPUT"
echo "runtime-cache-key=$TOOLCHAIN_NAME-runtime-$WORKFLOW_SHA-$BINUTILS_SHA-$GCC_SHA-$MINGW_SHA-$BINUTILS_SCRIPTS_SHA-$TOOLCHAIN_SCRIPTS_SHA" >> "$GITHUB_OUTPUT"
echo "ccache-key=$TARGET-ccache-$(date -u --iso-8601=seconds)" >> "$GITHUB_OUTPUT"
echo "ccache-restore-keys=$TARGET-ccache-" >> "$GITHUB_OUTPUT"
2 changes: 1 addition & 1 deletion .github/scripts/get-files-sha.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

echo sha=$(cd $1; git log -1 --pretty=format:"%H" ${@:2}) >> "$GITHUB_OUTPUT"
echo $(cd $1; git log -1 --pretty=format:"%H" ${@:2})
2 changes: 1 addition & 1 deletion .github/scripts/get-repository-sha.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

remote=$( git ls-remote -h https://github.com/$1 $2 | tee /dev/fd/2 )
echo sha=$(echo $remote | cut -d ' ' -f1 | tr -d '[:blank:]' ) >> "$GITHUB_OUTPUT"
echo $(echo $remote | cut -d ' ' -f1 | tr -d '[:blank:]' )
19 changes: 18 additions & 1 deletion .github/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,24 @@ source `dirname ${BASH_SOURCE[0]}`/config.sh

echo "::group::Install Dependencies"
sudo apt update
sudo apt install -y build-essential autogen autoconf automake autotools-dev binutils-for-build texinfo bison flex ccache docbook2x xmlto zlib1g-dev libc6-dev-arm64-cross libc6-dev-amd64-cross dejagnu
sudo apt install -y \
autoconf \
autogen \
automake \
autotools-dev \
binutils-for-build \
bison \
build-essential \
ccache \
dejagnu \
docbook2x \
flex \
libc6-dev-arm64-cross \
libc6-dev-amd64-cross \
texinfo \
xmlto \
zlib1g-dev \
zstd
echo "::endgroup::"

echo 'Success!'
10 changes: 10 additions & 0 deletions .github/scripts/install-zstd.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

. $PSScriptRoot\config.ps1

Write-Output "::group::Install zstd"
Invoke-WebRequest https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-v1.5.2-win64.zip -OutFile $env:RUNNER_TEMP\zstd.zip
Expand-Archive $env:RUNNER_TEMP\zstd.zip -DestinationPath $env:RUNNER_TEMP
Add-Content $env:GITHUB_PATH "$env:RUNNER_TEMP\zstd-v1.5.2-win64"
Write-Output "::endgroup::"

Write-Output 'Success!'
10 changes: 0 additions & 10 deletions .github/scripts/toolchain/pack-mock.sh

This file was deleted.

10 changes: 0 additions & 10 deletions .github/scripts/toolchain/pack-runtime-mock.sh

This file was deleted.

Loading

0 comments on commit 2db553c

Please sign in to comment.