workflow: Move ccache setting from build.yml to cibuild.sh

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-12-10 18:29:47 +08:00
committed by Xiang Xiao
parent 98412b9e97
commit b83f3e6ca7
2 changed files with 8 additions and 13 deletions
+3 -9
View File
@@ -154,18 +154,15 @@ jobs:
with: with:
run: | run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json" echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
export ARTIFACTDIR=`pwd`/buildartifacts export ARTIFACTDIR=`pwd`/buildartifacts
git config --global --add safe.directory /github/workspace/sources/nuttx git config --global --add safe.directory /github/workspace/sources/nuttx
git config --global --add safe.directory /github/workspace/sources/apps git config --global --add safe.directory /github/workspace/sources/apps
cd sources/nuttx/tools/ci cd sources/nuttx/tools/ci
if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then 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 else
./cibuild.sh -A -R -c testlist/${{matrix.boards}}.dat ./cibuild.sh -c -A -R testlist/${{matrix.boards}}.dat
fi fi
ccache -s
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: ${{ always() }} if: ${{ always() }}
@@ -212,12 +209,9 @@ jobs:
- name: Run Builds - name: Run Builds
run: | run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json" echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
export ARTIFACTDIR=`pwd`/buildartifacts export ARTIFACTDIR=`pwd`/buildartifacts
cd sources/nuttx/tools/ci cd sources/nuttx/tools/ci
./cibuild.sh -i -A -R -c testlist/${{matrix.boards}}.dat ./cibuild.sh -i -c -A -R testlist/${{matrix.boards}}.dat
ccache -s
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
+5 -4
View File
@@ -420,10 +420,7 @@ function usage {
} }
function enable_ccache { function enable_ccache {
export USE_CCACHE=1; export CCACHE_DIR="${tools}"/ccache
ccache -z
ccache -M 5G;
ccache -s
} }
function setup_links { function setup_links {
@@ -515,6 +512,10 @@ function run_builds {
for build in "${builds[@]}"; do for build in "${builds[@]}"; do
"${nuttx}"/tools/testbuild.sh ${options} -e "-Wno-cpp -Werror" "${build}" "${nuttx}"/tools/testbuild.sh ${options} -e "-Wno-cpp -Werror" "${build}"
done done
if [ -d "${CCACHE_DIR}" ]; then
ccache -s
fi
} }
if [ -z "$1" ]; then if [ -z "$1" ]; then