Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmlee101 committed May 31, 2024
1 parent 988cc5c commit 7df8501
Showing 1 changed file with 18 additions and 67 deletions.
85 changes: 18 additions & 67 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ export CC=gcc-13
# Add the current working directory to $PATH so that tests can find bedrock.
export PATH=$PATH:`pwd`

# Configure ccache settings for travis.
export PATH=/usr/lib/ccache:$PATH
/usr/sbin/update-ccache-symlinks

export CCACHE_COMPILERCHECK="mtime"

# We have include_file_ctime and include_file_mtime since travis never modifies the header file during execution
Expand All @@ -23,82 +19,37 @@ export CCACHE_MAXSIZE="1G"
export CCACHE_COMPRESS="true"
export CCACHE_COMPRESSLEVEL="1"

travis_time_start() {
travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
travis_start_time=$(travis_nanoseconds)
echo -en "travis_time:start:$travis_timer_id\r${ANSI_CLEAR}"
}

travis_time_finish() {
local result=$?
travis_end_time=$(travis_nanoseconds)
local duration=$(($travis_end_time-$travis_start_time))
echo -en "travis_time:end:$travis_timer_id:start=$travis_start_time,finish=$travis_end_time,duration=$duration\r${ANSI_CLEAR}"
return $result
}

travis_nanoseconds() {
local cmd="date"
local format="+%s%N"
local os=$(uname)

if hash gdate > /dev/null 2>&1; then
cmd="gdate" # use gdate if available
elif [[ "$os" = Darwin ]]; then
format="+%s000000000" # fallback to second precision on darwin (does not support %N)
fi

$cmd -u $format
}

travis_fold() {
mark_fold() {
local action=$1
local name=$2
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
}

travis_fold start install_packages
travis_time_start

if [[ -z "${APT_MIRROR_PASSWORD}" ]]; then
echo "Running on a fork, using public apt mirror"
sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
else
echo "Not running a fork, using private apt mirror"
sudo openssl aes-256-cbc -K $encrypted_f9e02b3c1033_key -iv $encrypted_f9e02b3c1033_iv -in expensify.ca.crt.enc -out /usr/local/share/ca-certificates/expensify.ca.crt -d
sudo update-ca-certificates
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA9EF27F
echo "deb [arch=amd64] https://travis:$APT_MIRROR_PASSWORD@apt-mirror.expensify.com:843/mirror/ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal main" | sudo tee -a /etc/apt/sources.list
fi

sudo apt-get update -y
sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install gcc-13 g++-13
# if action == end, just print out ::endgroup::
if [[ "$action" == "end" ]]; then
echo ::endgroup::
return
fi

travis_time_finish
travis_fold end build_bedrock
echo "::group::${name}"
}

# don't print out versions until after they are installed
${CC} --version
${CXX} --version

travis_fold start build_bedrock
travis_time_start
make -j32
travis_time_finish
travis_fold end build_bedrock
mark_fold start build_bedrock
make -j64
mark_fold end build_bedrock

travis_fold start test_bedrock
travis_time_start
mark_fold start test_bedrock
cd test
./test -threads 32
./test -threads 64
cd ..
travis_time_finish
travis_fold end test_bedrock
mark_fold end test_bedrock

travis_fold start test_bedrock_cluster
travis_time_start
mark_fold start test_bedrock_cluster
cd test/clustertest
./clustertest -threads 8
cd ../..
travis_time_finish
travis_fold end test_bedrock_cluster
mark_fold end test_bedrock_cluster

strip bedrock

0 comments on commit 7df8501

Please sign in to comment.