Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
111 changes: 102 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ concurrency:
cancel-in-progress: true

jobs:
build-and-test:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -36,17 +33,113 @@ jobs:
run: |
cmake --build build --parallel $(nproc)

- name: Run unit tests
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
build/bin/
build/lib/
retention-days: 1

test-unit:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: build/

- name: Run unit tests (cache)
run: |
./build/bin/test_cache

- name: Run unit tests (gossip)
run: |
./build/bin/test_gossip

- name: Run unit tests (transfer)
run: |
cd build
ctest --output-on-failure --timeout 300
./build/bin/test_transfer

- name: Run unit tests (storage)
run: |
./build/bin/test_storage

test-integration:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: build/

- name: Run integration tests
run: |
./build/bin/test_integration

test-functional:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: build/

- name: Run functional tests
run: |
./build/bin/test_functional

test-e2e:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: build/

- name: Run E2E tests
run: |
./build/bin/test_e2e

test-all:
needs: [test-unit, test-integration, test-functional, test-e2e]
runs-on: ubuntu-latest
steps:
- name: Summary
run: |
echo "All tests passed!"

upload-logs:
needs: [test-unit, test-integration, test-functional, test-e2e]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Upload test logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: |
build/Testing/**/*.log
build/test/*.log
build/bin/*.log
retention-days: 7
15 changes: 15 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,20 @@ if(ENABLE_TESTING)
target_link_libraries(test_storage PRIVATE ElioP2Plib OpenSSL::SSL OpenSSL::Crypto Catch2::Catch2WithMain)
catch_discover_tests(test_storage)

# Add integration test executable
add_executable(test_integration test_integration.cpp)
target_link_libraries(test_integration PRIVATE ElioP2Plib OpenSSL::SSL OpenSSL::Crypto Catch2::Catch2WithMain)
catch_discover_tests(test_integration)

# Add functional test executable
add_executable(test_functional test_functional.cpp)
target_link_libraries(test_functional PRIVATE ElioP2Plib OpenSSL::SSL OpenSSL::Crypto Catch2::Catch2WithMain)
catch_discover_tests(test_functional)

# Add E2E test executable
add_executable(test_e2e test_e2e.cpp)
target_link_libraries(test_e2e PRIVATE ElioP2Plib OpenSSL::SSL OpenSSL::Crypto Catch2::Catch2WithMain)
catch_discover_tests(test_e2e)

message(STATUS "Testing enabled with Catch2")
endif()
Loading
Loading