From 4fb962a0b9a1a9d96f13d78eab1c626d657b77c5 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Thu, 1 Jul 2021 16:03:13 +0300 Subject: [PATCH] CI: Add x86_64 on target tests --- .github/workflows/cmake.yml | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9f701f120f3a1b..722de66353d131 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -20,8 +20,13 @@ jobs: matrix: debug-options: ['ALL_DEBUG', 'NORMAL_DEBUG'] os: [ubuntu-20.04] + arch: ['i686', 'x86_64'] # If ccache is broken and you would like to bust the ccache cache on Github Actions, increment this: ccache-mark: [0] + exclude: + # We currently manually disable the ALL_DEBUG build on x86_64 for sake of saving CI time, as it is not our main target right now + - debug-options: 'ALL_DEBUG' + arch: 'x86_64' steps: - uses: actions/checkout@v2 @@ -81,9 +86,9 @@ jobs: # This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain. # This is wrong, and causes more Toolchain rebuilds than necessary. # However, we want to avoid false cache hits at all costs. - key: ${{ runner.os }}-toolchain-i686-${{ steps.stamps.outputs.libc_headers }} + key: ${{ runner.os }}-toolchain-${{ matrix.arch }}-${{ steps.stamps.outputs.libc_headers }} - name: Restore or regenerate Toolchain - run: TRY_USE_LOCAL_TOOLCHAIN=y ${{ github.workspace }}/Toolchain/BuildIt.sh + run: TRY_USE_LOCAL_TOOLCHAIN=y ARCH="${{ matrix.arch }}" ${{ github.workspace }}/Toolchain/BuildIt.sh - name: ccache(1) cache # Pull the ccache *after* building the toolchain, in case building the Toolchain somehow interferes. # TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. @@ -97,18 +102,18 @@ jobs: # This is achieved by using the "prefix-timestamp" format, # and permitting the restore-key "prefix-" without specifying a timestamp. # For this trick to work, the timestamp *must* come last, and it *must* be missing in 'restore-keys'. - key: ${{ runner.os }}-ccache-i686-v${{ matrix.ccache-mark }}-D${{ matrix.debug-options }}-toolchain_${{steps.stamps.outputs.libc_headers}}-time${{ steps.stamps.outputs.time }} + key: ${{ runner.os }}-ccache-${{ matrix.arch }}-v${{ matrix.ccache-mark }}-D${{ matrix.debug-options }}-toolchain_${{steps.stamps.outputs.libc_headers}}-time${{ steps.stamps.outputs.time }} # IMPORTANT: Keep these two in sync! restore-keys: | - ${{ runner.os }}-ccache-i686-v${{ matrix.ccache-mark }}-D${{ matrix.debug-options }}-toolchain_${{steps.stamps.outputs.libc_headers}}- + ${{ runner.os }}-ccache-${{ matrix.arch }}-v${{ matrix.ccache-mark }}-D${{ matrix.debug-options }}-toolchain_${{steps.stamps.outputs.libc_headers}}- - name: Show ccache stats before build and configure run: | # We only have 5 GiB of cache available *in total*. Beyond that, GitHub deletes caches. - # Currently, we use about 65 MB for the toolchain, and two ccache caches: - # One with ALL_DEBUG and one with NORMAL_DEBUG. - # Therefore, using 2.47 GB or more per ccache cache causes disaster. - # Building from scratch fills the ccache cache from 0 to about 0.7 GB, so 1.5 GB is plenty. - ccache -M 1500M + # Currently, we use about 130 MB for the two toolchains (i686 & x86_64), and four ccache caches: + # Two with ALL_DEBUG (i686 & x86_64) and two with NORMAL_DEBUG (i686 & x86_64). + # Therefore, using 1.25 GB or more per ccache cache causes disaster. + # Building from scratch fills the ccache cache from 0 to about 0.6 GB, so 1 GB is enough. + ccache -M 1000M ccache -s - name: Create build environment with extra debug options working-directory: ${{ github.workspace }} @@ -117,7 +122,7 @@ jobs: run: | mkdir -p Build cd Build - cmake .. -GNinja -DBUILD_LAGOM=ON -DENABLE_ALL_DEBUG_FACILITIES=ON -DENABLE_PCI_IDS_DOWNLOAD=OFF -DENABLE_USB_IDS_DOWNLOAD=OFF -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 + cmake .. -GNinja -DSERENITY_ARCH=${{ matrix.arch }} -DBUILD_LAGOM=ON -DENABLE_ALL_DEBUG_FACILITIES=ON -DENABLE_PCI_IDS_DOWNLOAD=OFF -DENABLE_USB_IDS_DOWNLOAD=OFF -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 if: ${{ matrix.debug-options == 'ALL_DEBUG' }} - name: Create build environment working-directory: ${{ github.workspace }} @@ -126,7 +131,7 @@ jobs: run: | mkdir -p Build cd Build - cmake .. -GNinja -DENABLE_UNDEFINED_SANITIZER=ON -DENABLE_PCI_IDS_DOWNLOAD=OFF -DENABLE_USB_IDS_DOWNLOAD=OFF -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 + cmake .. -GNinja -DSERENITY_ARCH=${{ matrix.arch }} -DENABLE_UNDEFINED_SANITIZER=ON -DENABLE_PCI_IDS_DOWNLOAD=OFF -DENABLE_USB_IDS_DOWNLOAD=OFF -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 if: ${{ matrix.debug-options == 'NORMAL_DEBUG' }} # === ACTUALLY BUILD === @@ -163,6 +168,9 @@ jobs: sudo cat fsmount/home/anon/test-results.log if ! sudo grep -q "Failed: 0" fsmount/home/anon/test-results.log then + if ${{ matrix.arch == 'x86_64' }}; then + exit 0 # We do not fail the job if were running on the x86_64 build, this should be removed once all tests pass + fi echo "::error :^( Tests failed, failing job" exit 1 fi