From f40a5b978eafad0c0ae8127e9ac623abc305505f Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Thu, 12 Nov 2020 20:42:51 +0100 Subject: [PATCH] .github: reduce duplicate for GCC and Clang build --- .github/workflows/test_sitl_copter.yml | 77 ++++++++----------------- .github/workflows/test_sitl_plane.yml | 67 ++++++--------------- .github/workflows/test_sitl_rover.yml | 67 ++++++--------------- .github/workflows/test_sitl_sub.yml | 67 ++++++--------------- .github/workflows/test_sitl_tracker.yml | 67 ++++++--------------- .github/workflows/test_unit_tests.yml | 71 +++++------------------ 6 files changed, 114 insertions(+), 302 deletions(-) diff --git a/.github/workflows/test_sitl_copter.yml b/.github/workflows/test_sitl_copter.yml index f3d9fa06c4..4f2844ef32 100644 --- a/.github/workflows/test_sitl_copter.yml +++ b/.github/workflows/test_sitl_copter.yml @@ -6,9 +6,16 @@ on: [push, pull_request] # - "!README.md" <-- don't rebuild on doc change jobs: - build-gcc: + build: runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-base:latest + container: khancyr/ardupilot-dev-${{ matrix.toolchain }}:latest + strategy: + fail-fast: false # don't cancel if a job from the matrix fails + matrix: + toolchain: [ + base, # GCC + clang, + ] steps: # git checkout the PR - uses: actions/checkout@v2 @@ -24,8 +31,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-${{ matrix.toolchain }}-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-${{ matrix.toolchain }}- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache @@ -35,57 +42,21 @@ jobs: echo "max_size = 400M" >> ~/.ccache/ccache.conf ccache -s ccache -z - - name: build copter + - name: build copter ${{ matrix.toolchain }} shell: bash run: | + if [[ ${{ matrix.toolchain }} = "clang" ]]; then + export CC=clang-7 + export CXX=clang++-7 + fi PATH="/github/home/.local/bin:$PATH" ./waf configure --board sitl ./waf build --target bin/arducopter ccache -s ccache -z - build-clang: - runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-clang:latest - steps: - # git checkout the PR - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - # Put ccache into github cache for faster build - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - run: | - NOW=$(date -u +"%F-%T") - echo "::set-output name=timestamp::${NOW}" - - name: ccache cache files - uses: actions/cache@v2 - with: - path: ~/.ccache - key: ${{github.workflow}}-ccache-clang-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache-clang- # restore ccache from either previous build on this branch or on master - - name: setup ccache - 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 copter - shell: bash - run: | - export CC=clang-7 - export CXX=clang++-7 - PATH="/github/home/.local/bin:$PATH" - ./waf configure --board sitl --board sitl - ./waf build --target bin/arducopter - ccache -s - ccache -z - autotest: - needs: build-gcc # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build + needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: khancyr/ardupilot-dev-base:latest strategy: @@ -116,8 +87,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache @@ -151,7 +122,7 @@ jobs: build-gcc-heli: - needs: build-gcc # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build + needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: khancyr/ardupilot-dev-base:latest steps: @@ -169,8 +140,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache @@ -215,8 +186,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache diff --git a/.github/workflows/test_sitl_plane.yml b/.github/workflows/test_sitl_plane.yml index f09fa1b1e9..9a8d470c5b 100644 --- a/.github/workflows/test_sitl_plane.yml +++ b/.github/workflows/test_sitl_plane.yml @@ -6,47 +6,16 @@ on: [push, pull_request] # - "!README.md" <-- don't rebuild on doc change jobs: - build-gcc: + build: runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-base:latest - steps: - # git checkout the PR - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - # Put ccache into github cache for faster build - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - run: | - NOW=$(date -u +"%F-%T") - echo "::set-output name=timestamp::${NOW}" - - name: ccache cache files - uses: actions/cache@v2 - with: - path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master - - name: setup ccache - 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 plane gcc - shell: bash - run: | - PATH="/github/home/.local/bin:$PATH" - ./waf configure --board sitl - ./waf build --target bin/arduplane - ccache -s - ccache -z - - build-clang: - runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-clang:latest + container: khancyr/ardupilot-dev-${{ matrix.toolchain }}:latest + strategy: + fail-fast: false # don't cancel if a job from the matrix fails + matrix: + toolchain: [ + base, # GCC + clang, + ] steps: # git checkout the PR - uses: actions/checkout@v2 @@ -62,8 +31,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-clang-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache-clang- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-${{ matrix.toolchain }}-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-${{ matrix.toolchain }}- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache @@ -73,11 +42,13 @@ jobs: echo "max_size = 400M" >> ~/.ccache/ccache.conf ccache -s ccache -z - - name: build plane clang + - name: build plane ${{ matrix.toolchain }} shell: bash run: | - export CC=clang-7 - export CXX=clang++-7 + if [[ ${{ matrix.toolchain }} = "clang" ]]; then + export CC=clang-7 + export CXX=clang++-7 + fi PATH="/github/home/.local/bin:$PATH" ./waf configure --board sitl ./waf build --target bin/arduplane @@ -85,7 +56,7 @@ jobs: ccache -z autotest: - needs: build-gcc # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build + needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: khancyr/ardupilot-dev-base:latest strategy: @@ -111,8 +82,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache diff --git a/.github/workflows/test_sitl_rover.yml b/.github/workflows/test_sitl_rover.yml index adf1ccfc72..fa6490fbb0 100644 --- a/.github/workflows/test_sitl_rover.yml +++ b/.github/workflows/test_sitl_rover.yml @@ -6,47 +6,16 @@ on: [push, pull_request] # - "!README.md" <-- don't rebuild on doc change jobs: - build-gcc: + build: runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-base:latest - steps: - # git checkout the PR - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - # Put ccache into github cache for faster build - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - run: | - NOW=$(date -u +"%F-%T") - echo "::set-output name=timestamp::${NOW}" - - name: ccache cache files - uses: actions/cache@v2 - with: - path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master - - name: setup ccache - 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 rover gcc - shell: bash - run: | - PATH="/github/home/.local/bin:$PATH" - ./waf configure --board sitl - ./waf build --target bin/ardurover - ccache -s - ccache -z - - build-clang: - runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-clang:latest + container: khancyr/ardupilot-dev-${{ matrix.toolchain }}:latest + strategy: + fail-fast: false # don't cancel if a job from the matrix fails + matrix: + toolchain: [ + base, # GCC + clang, + ] steps: # git checkout the PR - uses: actions/checkout@v2 @@ -62,8 +31,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-clang-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache-clang- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-${{ matrix.toolchain }}-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-${{ matrix.toolchain }}- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache @@ -73,11 +42,13 @@ jobs: echo "max_size = 400M" >> ~/.ccache/ccache.conf ccache -s ccache -z - - name: build rover clang + - name: build rover ${{ matrix.toolchain }} shell: bash run: | - export CC=clang-7 - export CXX=clang++-7 + if [[ ${{ matrix.toolchain }} = "clang" ]]; then + export CC=clang-7 + export CXX=clang++-7 + fi PATH="/github/home/.local/bin:$PATH" ./waf configure --board sitl ./waf build --target bin/ardurover @@ -85,7 +56,7 @@ jobs: ccache -z autotest: - needs: build-gcc # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build + needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: khancyr/ardupilot-dev-base:latest strategy: @@ -111,8 +82,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache diff --git a/.github/workflows/test_sitl_sub.yml b/.github/workflows/test_sitl_sub.yml index 9a4afe0656..865f7a9db9 100644 --- a/.github/workflows/test_sitl_sub.yml +++ b/.github/workflows/test_sitl_sub.yml @@ -6,47 +6,16 @@ on: [push, pull_request] # - "!README.md" <-- don't rebuild on doc change jobs: - build-gcc: + build: runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-base:latest - steps: - # git checkout the PR - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - # Put ccache into github cache for faster build - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - run: | - NOW=$(date -u +"%F-%T") - echo "::set-output name=timestamp::${NOW}" - - name: ccache cache files - uses: actions/cache@v2 - with: - path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master - - name: setup ccache - 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 sub gcc - shell: bash - run: | - PATH="/github/home/.local/bin:$PATH" - ./waf configure --board sitl - ./waf build --target bin/ardusub - ccache -s - ccache -z - - build-clang: - runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-clang:latest + container: khancyr/ardupilot-dev-${{ matrix.toolchain }}:latest + strategy: + fail-fast: false # don't cancel if a job from the matrix fails + matrix: + toolchain: [ + base, # GCC + clang, + ] steps: # git checkout the PR - uses: actions/checkout@v2 @@ -62,8 +31,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-clang-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache-clang- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-${{ matrix.toolchain }}-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-${{ matrix.toolchain }}- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache @@ -73,11 +42,13 @@ jobs: echo "max_size = 400M" >> ~/.ccache/ccache.conf ccache -s ccache -z - - name: build sub clang + - name: build sub ${{ matrix.toolchain }} shell: bash run: | - export CC=clang-7 - export CXX=clang++-7 + if [[ ${{ matrix.toolchain }} = "clang" ]]; then + export CC=clang-7 + export CXX=clang++-7 + fi PATH="/github/home/.local/bin:$PATH" ./waf configure --board sitl ./waf build --target bin/ardusub @@ -85,7 +56,7 @@ jobs: ccache -z autotest: - needs: build-gcc # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build + needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: khancyr/ardupilot-dev-base:latest strategy: @@ -110,8 +81,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache diff --git a/.github/workflows/test_sitl_tracker.yml b/.github/workflows/test_sitl_tracker.yml index 3bd98991e4..fbd93a5719 100644 --- a/.github/workflows/test_sitl_tracker.yml +++ b/.github/workflows/test_sitl_tracker.yml @@ -6,47 +6,16 @@ on: [push, pull_request] # - "!README.md" <-- don't rebuild on doc change jobs: - build-gcc: + build: runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-base:latest - steps: - # git checkout the PR - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - # Put ccache into github cache for faster build - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - run: | - NOW=$(date -u +"%F-%T") - echo "::set-output name=timestamp::${NOW}" - - name: ccache cache files - uses: actions/cache@v2 - with: - path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master - - name: setup ccache - 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 tracker gcc - shell: bash - run: | - PATH="/github/home/.local/bin:$PATH" - ./waf configure --board sitl - ./waf build --target bin/antennatracker - ccache -s - ccache -z - - build-clang: - runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-clang:latest + container: khancyr/ardupilot-dev-${{ matrix.toolchain }}:latest + strategy: + fail-fast: false # don't cancel if a job from the matrix fails + matrix: + toolchain: [ + base, # GCC + clang, + ] steps: # git checkout the PR - uses: actions/checkout@v2 @@ -62,8 +31,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-clang-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache-clang- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-${{ matrix.toolchain }}-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-${{ matrix.toolchain }}- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache @@ -73,11 +42,13 @@ jobs: echo "max_size = 400M" >> ~/.ccache/ccache.conf ccache -s ccache -z - - name: build antennatracker clang + - name: build tracker ${{ matrix.toolchain }} shell: bash run: | - export CC=clang-7 - export CXX=clang++-7 + if [[ ${{ matrix.toolchain }} = "clang" ]]; then + export CC=clang-7 + export CXX=clang++-7 + fi PATH="/github/home/.local/bin:$PATH" ./waf configure --board sitl ./waf build --target bin/antennatracker @@ -85,7 +56,7 @@ jobs: ccache -z autotest: - needs: build-gcc # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build + needs: build # don't try to launch the tests matrix if it doesn't build first, profit from caching for fast build runs-on: ubuntu-20.04 container: khancyr/ardupilot-dev-base:latest strategy: @@ -110,8 +81,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-base-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-base- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache diff --git a/.github/workflows/test_unit_tests.yml b/.github/workflows/test_unit_tests.yml index 82f5c19de5..cb9207cf49 100644 --- a/.github/workflows/test_unit_tests.yml +++ b/.github/workflows/test_unit_tests.yml @@ -6,60 +6,16 @@ on: [push, pull_request] # - "!README.md" <-- don't rebuild on doc change jobs: - build-gcc: + build: runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-base:latest + container: khancyr/ardupilot-dev-${{ matrix.toolchain }}:latest strategy: + fail-fast: false # don't cancel if a job from the matrix fails matrix: - config: [ - unit-tests + toolchain: [ + base, # GCC + clang, ] - steps: - # git checkout the PR - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - # Put ccache into github cache for faster build - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - run: | - NOW=$(date -u +"%F-%T") - echo "::set-output name=timestamp::${NOW}" - - name: ccache cache files - uses: actions/cache@v2 - with: - path: ~/.ccache - key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master - - name: setup ccache - 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: test ${{matrix.config}} gcc - env: - CI_BUILD_TARGET: ${{matrix.config}} - shell: bash - run: | - PATH="/github/home/.local/bin:$PATH" - Tools/scripts/build_ci.sh - - - name: Archive buildlog artifacts - uses: actions/upload-artifact@v2 - with: - name: buildlogs-for-gcc-${{matrix.config}} - path: /tmp/buildlogs - retention-days: 14 - - build-clang: - runs-on: ubuntu-20.04 - container: khancyr/ardupilot-dev-clang:latest - strategy: - matrix: config: [ unit-tests ] @@ -78,8 +34,8 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: ${{github.workflow}}-ccache-clang-${{steps.ccache_cache_timestamp.outputs.timestamp}} - restore-keys: ${{github.workflow}}-ccache-clang- # restore ccache from either previous build on this branch or on master + key: ${{github.workflow}}-ccache-${{ matrix.toolchain }}-${{steps.ccache_cache_timestamp.outputs.timestamp}} + restore-keys: ${{github.workflow}}-ccache-${{ matrix.toolchain }}- # restore ccache from either previous build on this branch or on master - name: setup ccache run: | mkdir -p ~/.ccache @@ -89,20 +45,21 @@ jobs: echo "max_size = 400M" >> ~/.ccache/ccache.conf ccache -s ccache -z - - name: test ${{matrix.config}} clang + - name: test ${{matrix.config}} ${{ matrix.toolchain }} env: CI_BUILD_TARGET: ${{matrix.config}} shell: bash run: | - export CC=clang-7 - export CXX=clang++-7 + if [[ ${{ matrix.toolchain }} = "clang" ]]; then + export CC=clang-7 + export CXX=clang++-7 + fi PATH="/github/home/.local/bin:$PATH" Tools/scripts/build_ci.sh - name: Archive buildlog artifacts uses: actions/upload-artifact@v2 with: - name: buildlogs-for-clang-${{matrix.config}} + name: buildlogs-for-${{ matrix.toolchain }}-${{matrix.config}} path: /tmp/buildlogs retention-days: 14 -