2021-12-21 08:50:46 +00:00
|
|
|
name: ci-tests
|
|
|
|
|
|
|
|
on:
|
2022-05-05 10:38:22 +00:00
|
|
|
# push:
|
|
|
|
# branches: [ main ]
|
2021-12-21 08:50:46 +00:00
|
|
|
pull_request:
|
2022-11-05 20:16:57 +00:00
|
|
|
branches: [main]
|
2021-12-21 08:50:46 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
2024-05-30 16:10:35 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-12-21 08:50:46 +00:00
|
|
|
jobs:
|
2022-11-05 20:16:57 +00:00
|
|
|
pre-commit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-01-27 17:02:53 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-11-05 20:16:57 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2024-02-06 09:57:26 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2022-11-05 20:16:57 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2024-10-15 09:15:57 +00:00
|
|
|
python -m venv venv
|
|
|
|
source venv/bin/activate
|
2022-11-05 20:16:57 +00:00
|
|
|
python -m pip install pre-commit
|
2024-06-30 12:46:11 +00:00
|
|
|
lsblk -l
|
|
|
|
echo "sda rotational = $(cat /sys/block/sda/queue/rotational)"
|
|
|
|
echo "sdb rotational = $(cat /sys/block/sdb/queue/rotational)"
|
2024-01-27 17:02:53 +00:00
|
|
|
- uses: actions/cache@v4
|
2022-11-05 20:16:57 +00:00
|
|
|
with:
|
|
|
|
path: ~/.cache/pre-commit
|
|
|
|
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
|
|
|
- name: Run pre-commit checks
|
2024-10-15 09:15:57 +00:00
|
|
|
run:
|
|
|
|
source venv/bin/activate
|
|
|
|
pre-commit run --show-diff-on-failure --color=always --from-ref HEAD^ --to-ref HEAD
|
2022-11-05 20:16:57 +00:00
|
|
|
shell: bash
|
2021-12-21 08:50:46 +00:00
|
|
|
build:
|
2022-02-19 20:56:09 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# Test of these containers
|
2022-04-25 09:06:31 +00:00
|
|
|
container: ["ubuntu-dev:20", "alpine-dev:latest"]
|
2022-12-11 11:52:45 +00:00
|
|
|
build-type: [Debug, Release]
|
2023-09-21 07:52:52 +00:00
|
|
|
compiler: [{ cxx: g++, c: gcc }]
|
2023-05-23 11:22:28 +00:00
|
|
|
cxx_flags: ["-Werror"]
|
|
|
|
include:
|
|
|
|
- container: "alpine-dev:latest"
|
|
|
|
build-type: Debug
|
2023-09-21 07:52:52 +00:00
|
|
|
compiler: { cxx: clang++, c: clang }
|
2023-05-23 11:22:28 +00:00
|
|
|
cxx_flags: ""
|
2024-06-30 12:46:11 +00:00
|
|
|
|
2024-07-01 07:43:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-08-25 07:58:11 +00:00
|
|
|
env:
|
2023-09-10 08:11:26 +00:00
|
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
|
|
SCCACHE_CACHE_SIZE: 6G
|
2023-08-27 07:57:29 +00:00
|
|
|
SCCACHE_ERROR_LOG: /tmp/sccache_log.txt
|
2024-02-05 08:29:11 +00:00
|
|
|
# SCCACHE_LOG: debug
|
2023-08-25 07:58:11 +00:00
|
|
|
|
2022-11-05 20:16:57 +00:00
|
|
|
container:
|
2022-05-11 17:37:25 +00:00
|
|
|
image: ghcr.io/romange/${{ matrix.container }}
|
2024-06-12 13:38:02 +00:00
|
|
|
# Seems that docker by default prohibits running iouring syscalls
|
|
|
|
options: --security-opt seccomp=unconfined --sysctl "net.ipv6.conf.all.disable_ipv6=0"
|
2024-02-06 09:57:26 +00:00
|
|
|
volumes:
|
|
|
|
- /:/hostroot
|
2024-06-30 12:46:11 +00:00
|
|
|
- /mnt:/mnt
|
2023-03-01 14:22:33 +00:00
|
|
|
credentials:
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2021-12-21 08:50:46 +00:00
|
|
|
steps:
|
2024-02-06 09:57:26 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-11-05 20:16:57 +00:00
|
|
|
with:
|
|
|
|
submodules: true
|
2024-02-06 09:57:26 +00:00
|
|
|
- name: Prepare Environment
|
2022-11-05 20:16:57 +00:00
|
|
|
run: |
|
2021-12-21 08:50:46 +00:00
|
|
|
uname -a
|
|
|
|
cmake --version
|
2023-09-21 07:52:52 +00:00
|
|
|
mkdir -p ${GITHUB_WORKSPACE}/build
|
2024-06-30 12:46:11 +00:00
|
|
|
mount
|
2023-08-25 07:58:11 +00:00
|
|
|
|
2024-02-06 09:57:26 +00:00
|
|
|
echo "===================Before freeing up space ============================================"
|
|
|
|
df -h
|
|
|
|
rm -rf /hostroot/usr/share/dotnet
|
|
|
|
rm -rf /hostroot/usr/local/share/boost
|
|
|
|
rm -rf /hostroot/usr/local/lib/android
|
|
|
|
rm -rf /hostroot/opt/ghc
|
|
|
|
echo "===================After freeing up space ============================================"
|
|
|
|
df -h
|
2024-06-30 12:46:11 +00:00
|
|
|
touch /mnt/foo
|
|
|
|
ls -la /mnt/foo
|
2023-08-25 07:58:11 +00:00
|
|
|
- name: Run sccache-cache
|
2024-11-04 20:36:20 +00:00
|
|
|
uses: mozilla-actions/sccache-action@v0.0.6
|
2023-08-25 07:58:11 +00:00
|
|
|
|
|
|
|
- name: Configure Cache Env
|
2024-07-02 10:04:00 +00:00
|
|
|
uses: actions/github-script@v7
|
2022-11-05 20:16:57 +00:00
|
|
|
with:
|
2023-08-25 07:58:11 +00:00
|
|
|
script: |
|
2023-09-10 08:11:26 +00:00
|
|
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
|
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')
|
2022-11-05 20:16:57 +00:00
|
|
|
|
|
|
|
- name: Configure CMake
|
|
|
|
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
|
|
|
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
|
|
|
run: |
|
2024-09-16 10:43:16 +00:00
|
|
|
# -no-pie to disable address randomization so we could symbolize stacktraces
|
2023-09-21 07:52:52 +00:00
|
|
|
cmake -B ${GITHUB_WORKSPACE}/build \
|
2023-05-22 02:21:01 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=${{matrix.build-type}} \
|
|
|
|
-GNinja \
|
2023-05-23 11:22:28 +00:00
|
|
|
-DCMAKE_C_COMPILER="${{matrix.compiler.c}}" \
|
|
|
|
-DCMAKE_CXX_COMPILER="${{matrix.compiler.cxx}}" \
|
2023-08-25 07:58:11 +00:00
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache \
|
2024-09-16 10:43:16 +00:00
|
|
|
-DCMAKE_CXX_FLAGS="${{matrix.cxx_flags}} -no-pie" -DWITH_AWS:BOOL=OFF \
|
2023-05-22 02:21:01 +00:00
|
|
|
-L
|
2023-09-21 07:52:52 +00:00
|
|
|
cd ${GITHUB_WORKSPACE}/build && pwd
|
2022-01-14 17:22:14 +00:00
|
|
|
du -hcs _deps/
|
2024-02-21 08:35:07 +00:00
|
|
|
|
2023-08-24 13:52:24 +00:00
|
|
|
- name: Build
|
2022-11-05 20:16:57 +00:00
|
|
|
run: |
|
2023-09-21 07:52:52 +00:00
|
|
|
cd ${GITHUB_WORKSPACE}/build
|
2024-02-06 09:57:26 +00:00
|
|
|
ninja search_family_test
|
|
|
|
df -h
|
|
|
|
echo "-----------------------------"
|
2022-02-25 08:03:42 +00:00
|
|
|
ninja src/all
|
2024-08-07 12:43:45 +00:00
|
|
|
|
2024-02-06 09:57:26 +00:00
|
|
|
- name: PostFail
|
|
|
|
if: failure()
|
|
|
|
run: |
|
|
|
|
echo "disk space is:"
|
|
|
|
df -h
|
2024-02-21 08:35:07 +00:00
|
|
|
|
2023-09-21 07:52:52 +00:00
|
|
|
- name: C++ Unit Tests
|
2023-08-24 13:52:24 +00:00
|
|
|
run: |
|
2023-09-21 07:52:52 +00:00
|
|
|
cd ${GITHUB_WORKSPACE}/build
|
2022-01-14 12:55:13 +00:00
|
|
|
echo Run ctest -V -L DFLY
|
2024-11-27 11:56:56 +00:00
|
|
|
GLOG_alsologtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 \
|
|
|
|
FLAGS_list_experimental_v2=true timeout 20m ctest -V -L DFLY
|
2023-08-03 17:13:36 +00:00
|
|
|
|
2023-10-02 14:07:50 +00:00
|
|
|
echo "Running tests with --force_epoll"
|
2023-10-22 17:05:27 +00:00
|
|
|
|
|
|
|
# Create a rule that automatically prints stacktrace upon segfault
|
|
|
|
cat > ./init.gdb <<EOF
|
|
|
|
catch signal SIGSEGV
|
|
|
|
command
|
|
|
|
bt
|
|
|
|
end
|
|
|
|
EOF
|
|
|
|
|
|
|
|
gdb -ix ./init.gdb --batch -ex r --args ./dragonfly_test --force_epoll
|
2024-08-29 20:30:26 +00:00
|
|
|
FLAGS_force_epoll=true GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 timeout 20m ctest -V -L DFLY
|
2023-08-09 08:00:46 +00:00
|
|
|
|
2023-10-22 17:05:27 +00:00
|
|
|
echo "Finished running tests with --force_epoll"
|
|
|
|
|
2023-08-03 17:13:36 +00:00
|
|
|
echo "Running tests with --cluster_mode=emulated"
|
2024-08-06 11:52:18 +00:00
|
|
|
FLAGS_cluster_mode=emulated timeout 20m ctest -V -L DFLY
|
2023-08-03 17:13:36 +00:00
|
|
|
|
|
|
|
echo "Running tests with both --cluster_mode=emulated & --lock_on_hashtags"
|
2024-08-06 11:52:18 +00:00
|
|
|
FLAGS_cluster_mode=emulated FLAGS_lock_on_hashtags=true timeout 20m ctest -V -L DFLY
|
2023-08-03 17:13:36 +00:00
|
|
|
|
2024-08-06 11:52:18 +00:00
|
|
|
timeout 5m ./dragonfly_test
|
|
|
|
timeout 5m ./multi_test --multi_exec_mode=1
|
|
|
|
timeout 5m ./multi_test --multi_exec_mode=3
|
|
|
|
timeout 5m ./json_family_test --jsonpathv2=false
|
2024-08-07 12:43:45 +00:00
|
|
|
timeout 5m ./tiered_storage_test --vmodule=db_slice=2 --logtostderr
|
2024-02-21 08:35:07 +00:00
|
|
|
- name: Upload unit logs on failure
|
|
|
|
if: failure()
|
2024-05-16 10:02:10 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2024-02-21 08:35:07 +00:00
|
|
|
with:
|
|
|
|
name: unit_logs
|
|
|
|
path: /tmp/*INFO*
|
|
|
|
|
2023-09-21 07:52:52 +00:00
|
|
|
- name: Run regression tests
|
|
|
|
if: matrix.container == 'ubuntu-dev:20'
|
|
|
|
uses: ./.github/actions/regression-tests
|
|
|
|
with:
|
|
|
|
dfly-executable: dragonfly
|
|
|
|
run-only-on-ubuntu-latest: true
|
|
|
|
build-folder-name: build
|
2024-08-04 12:41:17 +00:00
|
|
|
filter: ${{ matrix.build-type == 'Release' && '(not slow) and (not dbg_only)' || '(not slow) and (not opt_only)' }}
|
2024-02-21 08:35:07 +00:00
|
|
|
|
|
|
|
- name: Upload regression logs on failure
|
2024-02-05 08:29:11 +00:00
|
|
|
if: failure()
|
2024-05-16 10:02:10 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-08-27 07:57:29 +00:00
|
|
|
with:
|
2024-02-21 08:35:07 +00:00
|
|
|
name: regression_logs
|
2024-07-10 07:58:54 +00:00
|
|
|
path: /tmp/failed/*
|
2023-08-27 07:57:29 +00:00
|
|
|
|
2022-12-29 16:22:09 +00:00
|
|
|
lint-test-chart:
|
|
|
|
runs-on: ubuntu-latest
|
2024-06-30 12:46:11 +00:00
|
|
|
needs: [build]
|
2022-12-29 16:22:09 +00:00
|
|
|
steps:
|
2024-03-18 11:51:33 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-02-06 08:27:10 +00:00
|
|
|
- uses: ./.github/actions/lint-test-chart
|