From 32828c99fd9a998cb498787266436141d7beb16c Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 20 Jun 2020 13:18:06 -0400 Subject: [PATCH] github actions get ccache working --- .github/workflows/bloaty.yml | 34 +++++++++++++++++++--------- .github/workflows/build_tests.yml | 29 ++++++++++++++++++------ .github/workflows/compile_linux.yml | 28 +++++++++++++++++------ .github/workflows/compile_nuttx.yml | 29 ++++++++++++++++++------ .github/workflows/sitl_tests.yml | 35 +++++++++++++++++++++++------ 5 files changed, 117 insertions(+), 38 deletions(-) diff --git a/.github/workflows/bloaty.yml b/.github/workflows/bloaty.yml index 273a1ba014..86b6bb2643 100644 --- a/.github/workflows/bloaty.yml +++ b/.github/workflows/bloaty.yml @@ -20,26 +20,40 @@ jobs: config: [ px4_fmu-v2_default, px4_fmu-v4_default, - #px4_fmu-v4_optimized, + px4_fmu-v4_optimized, px4_fmu-v5_default, - #px4_fmu-v5_optimized, + px4_fmu-v5_optimized, px4_fmu-v5x_default, px4_io-v2_default, ] - container: px4io/px4-dev-nuttx-${{ matrix.ubuntu_release }}:2020-04-01 + container: px4io/px4-dev-nuttx-${{matrix.ubuntu_release}}:2020-04-01 steps: - uses: actions/checkout@v1 with: token: ${{secrets.ACCESS_TOKEN}} - - uses: actions/cache@v1.1.0 - id: ccache-persistence + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + - name: ccache cache files + uses: actions/cache@v1.1.0 with: path: ~/.ccache - key: ccache-nuttx-${{matrix.config}} - restore-keys: | - ccache-nuttx-${{matrix.config}} + key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{matrix.config}}-ccache- - name: setup ccache - run: mkdir -p ~/.ccache && echo "max_size = 300M" > ~/.ccache/ccache.conf && ccache -z && ccache -s + run: | + mkdir -p ~/.ccache + echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + echo "compression_level = 6" >> ~/.ccache/ccache.conf + echo "max_size = 400M" >> ~/.ccache/ccache.conf + ccache -s + ccache -z + - name: make ${{matrix.config}} run: make ${{matrix.config}} - name: make ${{matrix.config}} bloaty_compileunits @@ -55,4 +69,4 @@ jobs: - name: make ${{matrix.config}} bloaty_compare_master run: make ${{matrix.config}} bloaty_compare_master - name: ccache post-run - run: ccache -s && ccache -z + run: ccache -s diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml index 453e461155..69efb90f30 100644 --- a/.github/workflows/build_tests.yml +++ b/.github/workflows/build_tests.yml @@ -22,20 +22,35 @@ jobs: - uses: actions/checkout@v1 with: token: ${{ secrets.ACCESS_TOKEN }} + - name: check_format env: CI: true run: make check_format - - uses: actions/cache@v1.1.0 - id: ccache-persistence + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + - name: ccache cache files + uses: actions/cache@v1.1.0 with: path: ~/.ccache - key: ccache-main-tests - restore-keys: | - ccache-main-tests + key: ${{matrix.ubuntu_release}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{matrix.ubuntu_release}}-ccache- - name: setup ccache - run: mkdir -p ~/.ccache && echo "max_size = 300M" > ~/.ccache/ccache.conf && ccache -z && ccache -s + run: | + mkdir -p ~/.ccache + echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + echo "compression_level = 6" >> ~/.ccache/ccache.conf + echo "max_size = 400M" >> ~/.ccache/ccache.conf + ccache -s + ccache -z + - name: main tests run: make tests - name: ccache post-run - run: ccache -s && ccache -z + run: ccache -s diff --git a/.github/workflows/compile_linux.yml b/.github/workflows/compile_linux.yml index 2172ca833a..deac41a4a5 100644 --- a/.github/workflows/compile_linux.yml +++ b/.github/workflows/compile_linux.yml @@ -24,16 +24,30 @@ jobs: - uses: actions/checkout@v1 with: token: ${{secrets.ACCESS_TOKEN}} - - uses: actions/cache@v1.1.0 - id: ccache-persistence + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + - name: ccache cache files + uses: actions/cache@v1.1.0 with: path: ~/.ccache - key: ccache-linux-${{matrix.config}} - restore-keys: | - ccache-linux-${{matrix.config}} + key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{matrix.config}}-ccache- - name: setup ccache - run: mkdir -p ~/.ccache && echo "max_size = 300M" > ~/.ccache/ccache.conf && ccache -z && ccache -s + run: | + mkdir -p ~/.ccache + echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + echo "compression_level = 6" >> ~/.ccache/ccache.conf + echo "max_size = 400M" >> ~/.ccache/ccache.conf + ccache -s + ccache -z + - name: make ${{matrix.config}} run: make ${{matrix.config}} - name: ccache post-run - run: ccache -s && ccache -z + run: ccache -s diff --git a/.github/workflows/compile_nuttx.yml b/.github/workflows/compile_nuttx.yml index 0235b0c72b..41e6da7bf0 100644 --- a/.github/workflows/compile_nuttx.yml +++ b/.github/workflows/compile_nuttx.yml @@ -62,19 +62,34 @@ jobs: - uses: actions/checkout@v1 with: token: ${{secrets.ACCESS_TOKEN}} - - uses: actions/cache@v1.1.0 - id: ccache-persistence + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + - name: ccache cache files + uses: actions/cache@v1.1.0 with: path: ~/.ccache - key: ccache-nuttx-${{matrix.config}} - restore-keys: | - ccache-nuttx-${{matrix.config}} + key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{matrix.config}}-ccache- - name: setup ccache - run: mkdir -p ~/.ccache && echo "max_size = 300M" > ~/.ccache/ccache.conf && ccache -z && ccache -s + run: | + mkdir -p ~/.ccache + echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + echo "compression_level = 6" >> ~/.ccache/ccache.conf + echo "max_size = 400M" >> ~/.ccache/ccache.conf + ccache -s + ccache -z + - name: make ${{matrix.config}} run: make ${{matrix.config}} - name: ccache post-run - run: ccache -s && ccache -z + run: ccache -s + - name: Upload px4 package uses: actions/upload-artifact@v1 with: diff --git a/.github/workflows/sitl_tests.yml b/.github/workflows/sitl_tests.yml index d669c3a64c..2b864b2344 100644 --- a/.github/workflows/sitl_tests.yml +++ b/.github/workflows/sitl_tests.yml @@ -24,35 +24,55 @@ jobs: - uses: actions/checkout@v1 with: token: ${{ secrets.ACCESS_TOKEN }} + - name: Download MAVSDK run: wget https://github.com/mavlink/MAVSDK/releases/download/v0.27.0/mavsdk_0.27.0_ubuntu18.04_amd64.deb - name: Install MAVSDK run: dpkg -i mavsdk_0.27.0_ubuntu18.04_amd64.deb - - uses: actions/cache@v1.1.0 - id: ccache-persistence + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + - name: ccache cache files + uses: actions/cache@v1.1.0 with: path: ~/.ccache - key: ccache-sitl-tests - restore-keys: | - ccache-sitl-tests + key: ${{matrix.ubuntu_release}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{matrix.ubuntu_release}}-ccache- - name: setup ccache - run: mkdir -p ~/.ccache && echo "max_size = 1G" > ~/.ccache/ccache.conf && ccache -z && ccache -s + run: | + mkdir -p ~/.ccache + echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + echo "compression_level = 6" >> ~/.ccache/ccache.conf + echo "max_size = 400M" >> ~/.ccache/ccache.conf + ccache -s + ccache -z + - name: Build PX4 in SITL integration test mode run: DONT_RUN=1 make px4_sitl PX4_CMAKE_BUILD_TYPE=Coverage gazebo mavsdk_tests - name: ccache post-run - run: ccache -s && ccache -z + run: ccache -s + - name: Core dump settings run: | ulimit -c unlimited echo "`pwd`/%e.core" > /proc/sys/kernel/core_pattern + - name: Run SITL tests run: test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early test/mavsdk_tests/configs/sitl.json + - name: Run SITL tests in Southern hemisphere run: PX4_HOME_LAT=-37.8134048 PX4_HOME_LON=175.304109 PX4_HOME_ALT=32 | test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early test/mavsdk_tests/configs/sitl.json + - name: Run SITL tests far in the West run: PX4_HOME_LAT=59.6176928 PX4_HOME_LON=-151.1453163 PX4_HOME_ALT=48 | test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 --abort-early test/mavsdk_tests/configs/sitl.json + - name: Look at core files if: failure() run: gdb build/px4_sitl_default/bin/px4 px4.core -ex "thread apply all bt" -ex "quit" @@ -62,6 +82,7 @@ jobs: with: name: coredump path: px4.core + - name: Upload px4 binary if: failure() uses: actions/upload-artifact@v2-preview