Skip to content

Commit

Permalink
CI: Add x86_64 on target tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IdanHo authored and awesomekling committed Jul 1, 2021
1 parent 1bbf3f1 commit 4fb962a
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 ===
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4fb962a

Please sign in to comment.