SKALED-1812 Remove .get() #3443
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test skaled | |
on: | |
push: | |
branches-ignore: | |
- 'master' | |
- 'beta' | |
- 'stable' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
cancel-runs: | |
name: Cancel Previous Runs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
build: | |
runs-on: self-hosted | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
NO_ULIMIT_CHECK: 1 | |
ccache_compress: 'true' | |
ccache_compresslevel: 9 | |
steps: | |
- name: Extract repo name | |
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}') | |
shell: bash | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: Cache apt packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
/var/cache/apt/archives | |
key: ${{ runner.os }}-apt-cache | |
ttl: 1000000 # purge cache every 1000000 seconds (10 days). This is to pull updated packages | |
- name: update apt | |
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test; sudo apt-get update | |
- name: install packages | |
run: | | |
sudo apt-get -y remove libzmq* || true | |
sudo apt-get -y install software-properties-common | |
sudo apt-get -y install gcc-9 g++-9 | |
- name: Use g++-9 and gcov-9 by default | |
run: | | |
echo "Updating all needed alternatives" | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9 | |
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 9 | |
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 9 | |
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9 9 | |
echo "Checking alternative for gcc" | |
which gcc | |
gcc --version | |
echo "Checking alternative for g++" | |
which g++ | |
g++ --version | |
echo "Checking alternative for gcov" | |
which gcov | |
gcov --version | |
echo "Checking alternative for gcov-dump" | |
which gcov-dump | |
gcov-dump --version | |
echo "Checking alternative for gcov-tool" | |
which gcov-tool | |
gcov-tool --version | |
- name: Get newest lcov | |
run: | | |
# sudo apt-get install libcapture-tiny-perl | |
echo "Removing previous lcov version..." | |
sudo apt-get remove lcov || true | |
echo "Installing newest lcov version..." | |
rm -rf newer_lcov || true | |
mkdir newer_lcov | |
cd newer_lcov | |
git clone https://github.com/linux-test-project/lcov --recursive --recurse-submodules | |
cd lcov | |
git checkout 92e2121 | |
sudo make install | |
cd .. | |
cd .. | |
echo "Checking installed lcov version..." | |
which lcov | |
lcov --version | |
- name: Submodule update | |
run: | | |
rm -rf ./libconsensus || true | |
ls -1 | |
git submodule update --init --recursive | |
- name: Prepare ccache timestamp | |
id: ccache_cache_timestamp | |
shell: cmake -P {0} | |
run: | | |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) | |
message("::set-output name=timestamp::${current_date}") | |
- name: Ccache cache files | |
uses: actions/[email protected] | |
with: | |
path: .ccache | |
key: ${ { matrix.config.name } }-ccache-${ { steps.ccache_cache_timestamp.outputs.timestamp } } | |
restore-keys: | | |
${ { matrix.config.name } }-ccache- | |
- name: Update gcc-9 | |
run: | | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9 | |
- name: Configure ccache cache size, zero ccache counters and print ccache stats before start | |
run: | | |
ccache --max-size=30G | |
ccache -z | |
ccache --show-stats | |
- name: Build dependencies | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
export CC=gcc-9 | |
export CXX=g++-9 | |
export TARGET=all | |
export CMAKE_BUILD_TYPE=Debug | |
export CODE_COVERAGE=ON | |
cd deps | |
#######################################./clean.sh | |
rm -f ./libwebsockets-from-git.tar.gz | |
./build.sh DEBUG=1 PARALLEL_COUNT=$(nproc) | |
cd .. | |
- name: Print ccache stats for deps | |
run: | | |
ccache --show-stats | |
- name: Configure all as historic | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" && | |
export CC=gcc-9 && | |
export CXX=g++-9 && | |
export TARGET=all && | |
export CMAKE_BUILD_TYPE=Debug && | |
export CODE_COVERAGE=ON && | |
mkdir -p build && | |
cd build && | |
# -DCMAKE_C_FLAGS=-O3 -DCMAKE_CXX_FLAGS=-O3 | |
cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCOVERAGE=$CODE_COVERAGE -DHISTORIC_STATE=1 .. | |
cd .. | |
- name: Build all historic | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
export CC=gcc-9 | |
export CXX=g++-9 | |
export TARGET=all | |
export CMAKE_BUILD_TYPE=Debug | |
export CODE_COVERAGE=ON | |
cd build | |
make skaled testeth -j$(nproc) | |
cd .. | |
- name: Print ccache stats after full historic build | |
run : | | |
ccache --show-stats | |
- name: Use Node.js 19 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 19 | |
- name: run historic tests | |
run: | | |
build/skaled/skaled --config test/historicstate/configs/basic_config.json& | |
SKALED_PID=$! && | |
cd test/historicstate/hardhat/ && | |
npm install --save-dev typescript ts-node @types/node @types/mocha && | |
npx hardhat check && | |
sleep 60 && | |
npx hardhat run scripts/trace.ts --network skaled && | |
kill $SKALED_PID | |
- name: Configure all | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
export CC=gcc-9 | |
export CXX=g++-9 | |
export TARGET=all | |
export CMAKE_BUILD_TYPE=Debug | |
export CODE_COVERAGE=ON | |
mkdir -p build | |
cd build | |
# -DCMAKE_C_FLAGS=-O3 -DCMAKE_CXX_FLAGS=-O3 | |
cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCOVERAGE=$CODE_COVERAGE .. | |
cd .. | |
- name: Build all | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" && | |
export CC=gcc-9 && | |
export CXX=g++-9 && | |
export TARGET=all && | |
export CMAKE_BUILD_TYPE=Debug && | |
export CODE_COVERAGE=ON && | |
cd build && | |
make skaled testeth -j$(nproc) && | |
cd .. | |
- name: Print ccache stats after full build | |
run : | | |
ccache --show-stats | |
- name: Testeth verbosity 1 | |
run : | | |
#first run with verbosity 1. If test fails, rerun with verbosity 4 | |
cd build/test | |
export NO_NTP_CHECK=1 | |
export NO_ULIMIT_CHECK=1 | |
# we specifically run each test for easier log review | |
./testeth -t BlockchainTests -- --express && touch /tmp/BlockchainTestsPassed | |
./testeth -t TransitionTests -- --express && touch /tmp/TransitionTestsPassed | |
./testeth -t TransactionTests -- --express && touch /tmp/TransactionTestsPassed | |
./testeth -t VMTests -- --express && touch /tmp/VMTestsPassed | |
./testeth -t LevelDBTests -- --express && touch /tmp/LevelDBTestsPassed | |
./testeth -t CoreLibTests -- --express && touch /tmp/CoreLibTestsPassed | |
./testeth -t RlpTests -- --express && touch /tmp/RlpTestsPassed | |
./testeth -t SharedSpaceTests -- --express && touch /tmp/SharedSpaceTestsPassed | |
./testeth -t EthashTests -- --express && touch /tmp/EthashTestsPassed | |
./testeth -t SealEngineTests -- --express && touch /tmp/SealEngineTestsPassed | |
./testeth -t DifficultyTests -- --express && touch /tmp/DifficultyTestsPassed | |
./testeth -t BlockSuite -- --express && touch /tmp/BlockSuitePassed | |
./testeth -t BlockChainMainNetworkSuite -- --express && touch /tmp/BlockChainMainNetworkSuitePassed | |
./testeth -t BlockChainFrontierSuite -- --express && touch /tmp/BlockChainFrontierSuitePassed | |
./testeth -t BlockQueueSuite -- --express && touch /tmp/BlockQueueSuitePassed | |
./testeth -t ClientBase -- --express && touch /tmp/ClientBasePassed | |
./testeth -t EstimateGas -- --express && touch /tmp/EstimateGasPassed | |
./testeth -t IMABLSPublicKey -- --express && touch /tmp/IMABLSPublicKeyPassed | |
./testeth -t ExtVmSuite -- --express && touch /tmp/ExtVmSuitePassed | |
./testeth -t GasPricer -- --express && touch /tmp/GasPricerPassed | |
./testeth -t BasicTests -- --express && touch /tmp/BasicTestsPassed | |
./testeth -t InstanceMonitorSuite -- --express && touch /tmp/InstanceMonitorSuitePassed | |
./testeth -t PrecompiledTests -- --express && touch /tmp/PrecompiledTestsPassed | |
./testeth -t SkaleHostSuite -- --express && touch /tmp/SkaleHostSuitePassed | |
./testeth -t StateUnitTests -- --express && touch /tmp/StateUnitTestsPassed | |
./testeth -t libethereum -- --express && touch /tmp/libethereumPassed | |
./testeth -t TransactionQueueSuite -- --express && touch /tmp/TransactionQueueSuitePassed | |
./testeth -t LegacyVMSuite -- --express && touch /tmp/LegacyVMSuitePassed | |
./testeth -t SkaleInterpreterSuite -- --express && touch /tmp/SkaleInterpreterSuitePassed | |
./testeth -t SnapshotSigningTestSuite -- --express && touch /tmp/SnapshotSigningTestSuitePassed | |
./testeth -t SkUtils -- --express && touch /tmp/SkUtilsPassed | |
./testeth -t BlockChainTestSuite -- --express && touch /tmp/BlockChainTestSuitePassed | |
./testeth -t TestHelperSuite -- --express && touch /tmp/TestHelperSuitePassed | |
./testeth -t LevelDBHashBase -- --express && touch /tmp/LevelDBHashBasePassed | |
./testeth -t memDB -- --express && touch /tmp/memDBPassed | |
./testeth -t OverlayDBTests -- --express && touch /tmp/OverlayDBTestsPassed | |
./testeth -t AccountHolderTest -- --express && touch /tmp/AccountHolderTestPassed | |
./testeth -t ClientTests -- --express && touch /tmp/ClientTestsPassed | |
./testeth -t JsonRpcSuite -- --express && touch /tmp/JsonRpcSuitePassed | |
./testeth -t SingleConsensusTests -- --express && touch /tmp/SingleConsensusTestsPassed | |
./testeth -t ConsensusTests -- --express && touch /tmp/ConsensusTestsPassed | |
sudo ./testeth -t BtrfsTestSuite -- --all && touch /tmp/BtrfsTestSuitePassed | |
sudo ./testeth -t HashSnapshotTestSuite -- --all && touch /tmp/HashSnapshotTestSuitePassed | |
sudo ./testeth -t ClientSnapshotsSuite -- --all && touch /tmp/ClientSnapshotsSuitePassed | |
cd .. | |
- name: Testeth verbosity 4 | |
run : | | |
# Since a tests failed, we are rerunning the failed test with higher verbosity | |
cd build/test | |
export NO_NTP_CHECK=1 | |
export NO_ULIMIT_CHECK=1 | |
ls /tmp/BlockchainTestsPassed || ./testeth -t BlockchainTests -- --express --verbosity 4 | |
ls /tmp/TransitionTestsPassed || ./testeth -t TransitionTests -- --express --verbosity 4 | |
ls /tmp/TransactionTestsPassed || ./testeth -t TransactionTests -- --express --verbosity 4 | |
ls /tmp/VMTestsPassed || ./testeth -t VMTests -- --express --verbosity 4 | |
ls /tmp/LevelDBTestsPassed || ./testeth -t LevelDBTests -- --express --verbosity 4 | |
ls /tmp/CoreLibTestsPassed || ./testeth -t CoreLibTests -- --express --verbosity 4 | |
ls /tmp/RlpTestsPassed || ./testeth -t RlpTests -- --express --verbosity 4 | |
ls /tmp/SharedSpaceTestsPassed || ./testeth -t SharedSpaceTests -- --express --verbosity 4 | |
ls /tmp/EthashTestsPassed || ./testeth -t EthashTests -- --express --verbosity 4 | |
ls /tmp/SealEngineTestsPassed || ./testeth -t SealEngineTests -- --express --verbosity 4 | |
ls /tmp/DifficultyTestsPassed || ./testeth -t DifficultyTests -- --express --verbosity 4 | |
ls /tmp/BlockSuitePassed || ./testeth -t BlockSuite -- --express --verbosity 4 | |
ls /tmp/BlockChainMainNetworkSuitePassed || ./testeth -t BlockChainMainNetworkSuite -- --express --verbosity 4 | |
ls /tmp/BlockChainFrontierSuitePassed || ./testeth -t BlockChainFrontierSuite -- --express --verbosity 4 | |
ls /tmp/BlockQueueSuitePassed || ./testeth -t BlockQueueSuite -- --express --verbosity 4 | |
ls /tmp/ClientBasePassed || ./testeth -t ClientBase -- --express --verbosity 4 | |
ls /tmp/EstimateGasPassed || ./testeth -t EstimateGas -- --express --verbosity 4 | |
ls /tmp/IMABLSPublicKeyPassed || ./testeth -t IMABLSPublicKey -- --express --verbosity 4 | |
ls /tmp/ExtVmSuitePassed || ./testeth -t ExtVmSuite -- --express --verbosity 4 | |
ls /tmp/GasPricerPassed || ./testeth -t GasPricer -- --express --verbosity 4 | |
ls /tmp/BasicTestsPassed || ./testeth -t BasicTests -- --express --verbosity 4 | |
ls /tmp/InstanceMonitorSuitePassed || ./testeth -t InstanceMonitorSuite -- --express --verbosity 4 | |
ls /tmp/PrecompiledTestsPassed || ./testeth -t PrecompiledTests -- --express --verbosity 4 | |
ls /tmp/SkaleHostSuitePassed || ./testeth -t SkaleHostSuite -- --express --verbosity 4 | |
ls /tmp/StateUnitTestsPassed || ./testeth -t StateUnitTests -- --express --verbosity 4 | |
ls /tmp/libethereumPassed || ./testeth -t libethereum -- --express --verbosity 4 | |
ls /tmp/TransactionQueueSuitePassed || ./testeth -t TransactionQueueSuite -- --express --verbosity 4 | |
ls /tmp/LegacyVMSuitePassed || ./testeth -t LegacyVMSuite -- --express --verbosity 4 | |
ls /tmp/SkaleInterpreterSuitePassed || ./testeth -t SkaleInterpreterSuite -- --express --verbosity 4 | |
ls /tmp/SnapshotSigningTestSuitePassed || ./testeth -t SnapshotSigningTestSuite -- --express --verbosity 4 | |
ls /tmp/SkUtilsPassed || ./testeth -t SkUtils -- --express --verbosity 4 | |
ls /tmp/BlockChainTestSuitePassed || ./testeth -t BlockChainTestSuite -- --express --verbosity 4 | |
ls /tmp/TestHelperSuitePassed || ./testeth -t TestHelperSuite -- --express --verbosity 4 | |
ls /tmp/LevelDBHashBasePassed || ./testeth -t LevelDBHashBase -- --express --verbosity 4 | |
ls /tmp/memDBPassed || ./testeth -t memDB -- --express --verbosity 4 | |
ls /tmp/OverlayDBTestsPassed || ./testeth -t OverlayDBTests -- --express --verbosity 4 | |
ls /tmp/AccountHolderTestPassed || ./testeth -t AccountHolderTest -- --express --verbosity 4 | |
ls /tmp/ClientTestsPassed || ./testeth -t ClientTests -- --express --verbosity 4 | |
ls /tmp/JsonRpcSuitePassed || ./testeth -t JsonRpcSuite -- --express --verbosity 4 | |
ls /tmp/SingleConsensusTestsPassed || ./testeth -t SingleConsensusTests -- --express --verbosity 4 | |
ls /tmp/ConsensusTestsPassed || ./testeth -t ConsensusTests -- --express --verbosity 4 | |
ls /tmp/BtrfsTestSuitePassed || sudo NO_ULIMIT_CHECK=1 NO_NTP_CHECK=1 ./testeth -t BtrfsTestSuite -- --all --verbosity 4 | |
ls /tmp/HashSnapshotTestSuitePassed || sudo NO_ULIMIT_CHECK=1 NO_NTP_CHECK=1 ./testeth -t HashSnapshotTestSuite -- --all --verbosity 4 | |
ls /tmp/ClientSnapshotsSuitePassed || sudo NO_ULIMIT_CHECK=1 NO_NTP_CHECK=1 ./testeth -t ClientSnapshotsSuite -- --all --verbosity 4 | |
cd .. | |
- name: Create lcov report | |
run: | | |
lcov --capture --directory . --output-file coverage.info | |
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files | |
lcov --remove coverage.info 'deps/*' --output-file coverage.info # filter dependency files | |
lcov --remove coverage.info 'libconsensus/deps/*' --output-file coverage.info # filter dependency files | |
lcov --remove coverage.info 'libconsensus/libBLS/deps/*' --output-file coverage.info # filter dependency files | |
lcov --remove coverage.info '.hunter/*' --output-file coverage.info # filter dependency files | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.info | |