From b83f3e6ca706ab22ba95d2f2e451288c36cf0522 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 10 Dec 2022 18:29:47 +0800 Subject: [PATCH] workflow: Move ccache setting from build.yml to cibuild.sh Signed-off-by: Xiang Xiao --- .github/workflows/build.yml | 12 +++--------- tools/ci/cibuild.sh | 9 +++++---- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b6e856b30..b6c3689089 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,18 +154,15 @@ jobs: with: run: | echo "::add-matcher::sources/nuttx/.github/gcc.json" - export CCACHE_DIR=`pwd`/ccache - mkdir $CCACHE_DIR export ARTIFACTDIR=`pwd`/buildartifacts git config --global --add safe.directory /github/workspace/sources/nuttx git config --global --add safe.directory /github/workspace/sources/apps cd sources/nuttx/tools/ci if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then - ./cibuild.sh -A -R -c --codechecker testlist/${{matrix.boards}}.dat + ./cibuild.sh -c -A -R --codechecker testlist/${{matrix.boards}}.dat else - ./cibuild.sh -A -R -c testlist/${{matrix.boards}}.dat + ./cibuild.sh -c -A -R testlist/${{matrix.boards}}.dat fi - ccache -s - uses: actions/upload-artifact@v3 if: ${{ always() }} @@ -212,12 +209,9 @@ jobs: - name: Run Builds run: | echo "::add-matcher::sources/nuttx/.github/gcc.json" - export CCACHE_DIR=`pwd`/ccache - mkdir $CCACHE_DIR export ARTIFACTDIR=`pwd`/buildartifacts cd sources/nuttx/tools/ci - ./cibuild.sh -i -A -R -c testlist/${{matrix.boards}}.dat - ccache -s + ./cibuild.sh -i -c -A -R testlist/${{matrix.boards}}.dat - uses: actions/upload-artifact@v3 with: diff --git a/tools/ci/cibuild.sh b/tools/ci/cibuild.sh index 2e2847f046..fa1ae685e0 100755 --- a/tools/ci/cibuild.sh +++ b/tools/ci/cibuild.sh @@ -420,10 +420,7 @@ function usage { } function enable_ccache { - export USE_CCACHE=1; - ccache -z - ccache -M 5G; - ccache -s + export CCACHE_DIR="${tools}"/ccache } function setup_links { @@ -515,6 +512,10 @@ function run_builds { for build in "${builds[@]}"; do "${nuttx}"/tools/testbuild.sh ${options} -e "-Wno-cpp -Werror" "${build}" done + + if [ -d "${CCACHE_DIR}" ]; then + ccache -s + fi } if [ -z "$1" ]; then