Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 86 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

complete:
if: always()
needs: [static-checks, build-linux, build-mac]
needs: [static-checks, build-linux, build-mac, build-without-tests]
runs-on:
- namespace-profile-noble-24-04-stellar-core-x64-small
steps:
Expand Down Expand Up @@ -279,3 +279,88 @@ jobs:
if: ${{ success() && steps.check-last-tested-commit.outputs.skip != 'true' }}
run: |
echo "${{ github.sha }}" > "build-clang-current/.last-tested-commit-sha"

build-without-tests:
runs-on:
- namespace-profile-noble-24-04-stellar-core-x64-large;overrides.cache-tag=config-gcc-no-tests
steps:
- name: Fix kernel mmap rnd bits
# Asan in llvm provided in some ubuntu versions is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28

- name: Checkout with Namespace Git mirrors cache
uses: namespacelabs/nscloud-checkout-action@v7
with:
fetch-depth: 1
submodules: recursive

- name: Configure Namespace cache volume
uses: namespacelabs/nscloud-cache-action@v1
with:
path: |
~/.cargo
build-gcc-no-tests

- name: Check if commit already tested
id: check-last-tested-commit
run: |
LAST_TESTED_COMMIT_SHA_FILE="build-gcc-no-tests/.last-tested-commit-sha"
if [ -f "$LAST_TESTED_COMMIT_SHA_FILE" ] && [ "$(cat "$LAST_TESTED_COMMIT_SHA_FILE")" = "${{ github.sha }}" ]; then
echo "Commit ${{ github.sha }} already tested successfully, skipping build"
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
fi

- name: Install rustup
if: steps.check-last-tested-commit.outputs.skip != 'true'
run: ./install-rust.sh

- name: Install rustup components
if: steps.check-last-tested-commit.outputs.skip != 'true'
run: rustup component add rustfmt

- uses: stellar/binaries@v50
if: steps.check-last-tested-commit.outputs.skip != 'true'
with:
name: cargo-cache
version: 0.8.3

- uses: stellar/binaries@v50
if: steps.check-last-tested-commit.outputs.skip != 'true'
with:
name: cargo-sweep
version: 0.7.0

# Restore original modification time of files based on the date of the most
# recent commit that modified them as mtimes affect the Go test cache.
- name: Restore modification time of checkout files
if: steps.check-last-tested-commit.outputs.skip != 'true'
shell: bash
run: |
# Set a base, fixed modification time of all directories.
# git-restore-mtime doesn't set the mtime of all directories.
# (see https://github.com/MestreLion/git-tools/issues/47 for details)
touch -m -t '201509301646' $(find . -type d -not -path '.git/*')
# Restore original modification time from git. git clone sets the
# modification time to the current time, but Go tests that access fixtures
# get invalidated if their modification times change.
#
# Note: git-restore-mtime needs to be baked into the image we're
# running on.
git restore-mtime

- name: Build
if: steps.check-last-tested-commit.outputs.skip != 'true'
run: |
export CC='gcc'
export CXX='g++'
echo Building with $CC and $CXX with --disable-tests
./ci-build.sh --disable-tests --protocol current

- name: Record successful test commit
if: ${{ success() && steps.check-last-tested-commit.outputs.skip != 'true' }}
run: |
echo "${{ github.sha }}" > "build-gcc-no-tests/.last-tested-commit-sha"
4 changes: 3 additions & 1 deletion ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export TEMP_POSTGRES=0

PROTOCOL_CONFIG=""
DISABLE_POSTGRES=""
DISABLE_TESTS=""

while [[ -n "$1" ]]; do
COMMAND="$1"
Expand All @@ -21,6 +22,7 @@ while [[ -n "$1" ]]; do
case "${COMMAND}" in
"--disable-tests")
WITH_TESTS=0
DISABLE_TESTS='--disable-tests'
echo Disabling tests
;;
"--use-temp-db")
Expand Down Expand Up @@ -118,7 +120,7 @@ elif test $CXX = 'g++'; then
g++ -v
fi

config_flags="--enable-asan --enable-extrachecks --enable-ccache --enable-sdfprefs --enable-threadsafety ${PROTOCOL_CONFIG} ${DISABLE_POSTGRES}"
config_flags="--enable-asan --enable-extrachecks --enable-ccache --enable-sdfprefs --enable-threadsafety ${PROTOCOL_CONFIG} ${DISABLE_POSTGRES} ${DISABLE_TESTS}"
export CFLAGS="-O2 -g1 -fno-omit-frame-pointer -fsanitize-address-use-after-scope -fno-common"
export CXXFLAGS="$CFLAGS"

Expand Down
Loading