-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate CI from CircleCI to GitHub Actions and modernize test infrastructure #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
72a5a64
37bd4b6
3c213a6
9df9832
91bde24
deb933e
c19ec17
614ef50
b2326d4
fd84ee4
df8e959
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| version: 2 | ||
| updates: | ||
| # Maintain dependencies for GitHub Actions | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 10 | ||
|
|
||
| # Maintain dependencies for git submodules | ||
| - package-ecosystem: "gitsubmodule" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 10 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - 'release/*' | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| strategy: | ||
| matrix: | ||
| build_type: [Debug, Release] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y cmake g++ | ||
|
|
||
| - name: Configure CMake | ||
| run: | | ||
| mkdir build | ||
| cd build | ||
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. | ||
|
|
||
| - name: Build | ||
| run: | | ||
| cd build | ||
| make | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| cd build | ||
| ./test/testmain |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,5 +33,6 @@ | |
|
|
||
| /.idea/ | ||
| /cmake-*/ | ||
| /build-*/ | ||
| /test/catch.hpp | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| [submodule "deps/fbitset"] | ||
| path = deps/fbitset | ||
| url = https://github.com/tschijnmo/fbitset | ||
| url = https://github.com/DrudgeCAS/fbitset |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| [](https://circleci.com/gh/tschijnmo/libparenth) | ||
| [](https://github.com/DrudgeCAS/libparenth/actions/workflows/ci.yml) | ||
|
|
||
| # libparenth | ||
| Fast searching for optimal parenthesization of tensor contractions |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,17 @@ | ||
| # Download the Catch2 single header. | ||
| # Fetch Catch2 v3.11.0 | ||
| include(FetchContent) | ||
|
|
||
| file(DOWNLOAD | ||
| "https://github.com/catchorg/Catch2/releases/download/v2.0.1/catch.hpp" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/catch.hpp" | ||
| ) | ||
| FetchContent_Declare( | ||
| Catch2 | ||
| GIT_REPOSITORY https://github.com/catchorg/Catch2.git | ||
| GIT_TAG v3.11.0 | ||
| ) | ||
|
|
||
| include_directories(testmain | ||
| PRIVATE ${CMAKE_CURRENT_BINARY_DIR} | ||
| ) | ||
| FetchContent_MakeAvailable(Catch2) | ||
|
|
||
| # The main test driver. | ||
| add_executable(testmain | ||
| testmain.cpp | ||
| matrixchain.cpp | ||
| ) | ||
|
|
||
| target_link_libraries(testmain PRIVATE Catch2::Catch2WithMain) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,12 +10,22 @@ | |
| */ | ||
|
|
||
| #include <initializer_list> | ||
| #include <sstream> | ||
| #include <vector> | ||
|
|
||
| #include <catch.hpp> | ||
|
|
||
| #include <libparenth.hpp> | ||
|
|
||
| // Disable Catch2's range detection for fbitset by providing stream insertion operator | ||
| namespace fbitset { | ||
| template<int N> | ||
| inline std::ostream& operator<<(std::ostream& os, const Fbitset<N>& fs) { | ||
| os << "Fbitset<" << N << ">{count=" << fs.count() << "}"; | ||
| return os; | ||
| } | ||
| } | ||
|
Comment on lines
+19
to
+25
|
||
|
|
||
| #include <catch2/catch_test_macros.hpp> | ||
|
|
||
| using namespace libparenth; | ||
|
|
||
| TEST_CASE("A simple chain product of three matrices can be parenthesized") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,2 @@ | ||
| #define CATCH_CONFIG_RUNNER | ||
| #include <catch.hpp> | ||
|
|
||
| int main(int argc, char* argv[]) | ||
| { | ||
| int result = Catch::Session().run(argc, argv); | ||
| return result; | ||
| } | ||
| // Main test runner is provided by Catch2::Catch2WithMain | ||
| // This file is kept for potential future custom main() if needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CMakeLists.txt no longer includes
testmain.cppin theadd_executablecall, but the file still exists in the repository. Since the file now only contains comments andCatch2::Catch2WithMainprovides the main function,testmain.cppshould either be:The current state where the file exists but isn't compiled is inconsistent and may cause confusion.