diff --git a/.github/workflows/ubuntu-build.yml b/.github/workflows/ubuntu-build.yml index 4737f70..e55eaa9 100644 --- a/.github/workflows/ubuntu-build.yml +++ b/.github/workflows/ubuntu-build.yml @@ -2,9 +2,8 @@ name: Linux Build on: push: - branches: [ "master", "develop" ] - pull_request: branches: [ "master" ] + pull_request: jobs: build: @@ -52,4 +51,4 @@ jobs: - name: Test working-directory: build - run: ctest --output-on-failure \ No newline at end of file + run: ctest --build-config ${{ matrix.build_type }} --output-on-failure \ No newline at end of file diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml new file mode 100644 index 0000000..40008f1 --- /dev/null +++ b/.github/workflows/windows-build.yml @@ -0,0 +1,38 @@ +name: Windows Build (Clang-cl) + +on: + push: + branches: [ "master" ] + pull_request: + +jobs: + build: + runs-on: windows-2025-vs2026 + strategy: + fail-fast: false + matrix: + build_type: [Release, Debug] + + steps: + - uses: actions/checkout@v4 + + - name: Install Ninja + run: choco install ninja + + - name: Set up MSVC dev cmd + uses: ilammy/msvc-dev-cmd@v1 + + - name: Configure & Build + run: | + cmake -G Ninja -B build ` + -DCMAKE_C_COMPILER=clang-cl ` + -DCMAKE_CXX_COMPILER=clang-cl ` + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ` + -DENABLE_TESTS=ON ` + -DCMAKE_CXX_STANDARD=26 + + cmake --build build + + - name: Test + working-directory: build + run: ctest --output-on-failure \ No newline at end of file diff --git a/.github/workflows/windows-build.yml.disabled b/.github/workflows/windows-build.yml.disabled deleted file mode 100644 index 3046c22..0000000 --- a/.github/workflows/windows-build.yml.disabled +++ /dev/null @@ -1,29 +0,0 @@ -name: Windows Build - -on: - push: - branches: [ "master", "develop" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - build_type: [Release, Debug] - - steps: - - uses: actions/checkout@v4 - - - name: Configure & Build - run: | - cmake -B build ` - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ` - -DENABLE_TESTS=ON - cmake --build build --config ${{ matrix.build_type }} - - - name: Test - working-directory: build - run: ctest --build-config ${{ matrix.build_type }} --output-on-failure \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 54eb46e..cdadfd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,24 +23,9 @@ endif () include(cmake/CPM.cmake) if (ENABLE_TESTS) - CPMAddPackage( - NAME catch2 - URI "gh:catchorg/Catch2@3.13.0" - DOWNLOAD_ONLY YES - ) - if (catch2_ADDED) - add_library(Catch2WithMain STATIC - ${catch2_SOURCE_DIR}/extras/catch_amalgamated.hpp - ${catch2_SOURCE_DIR}/extras/catch_amalgamated.cpp - ) - target_include_directories(Catch2WithMain PUBLIC - $ - ) - # Include catch_discover_tests - list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) - include(Catch) - endif () - + CPMAddPackage("gh:catchorg/Catch2@3.13.0") + list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras) + include(Catch) endif () add_library(korka_lib diff --git a/test/bytecode_builder.cpp b/test/bytecode_builder.cpp index 76a785c..3961b47 100644 --- a/test/bytecode_builder.cpp +++ b/test/bytecode_builder.cpp @@ -1,4 +1,4 @@ -#include +#include #include "korka/vm/bytecode_builder.hpp" #include "korka/utils/byte_writer.hpp" #include "korka/vm/op_codes.hpp" diff --git a/test/lexer.cpp b/test/lexer.cpp index 7955ef4..21893bf 100644 --- a/test/lexer.cpp +++ b/test/lexer.cpp @@ -1,5 +1,6 @@ #include "korka/compiler/lexer.hpp" -#include +#include +#include TEST_CASE("lex_token: Equality operator", "[lexer][unit]") { using namespace korka; diff --git a/test/parser.cpp b/test/parser.cpp index ed3b21d..21653e9 100644 --- a/test/parser.cpp +++ b/test/parser.cpp @@ -1,4 +1,5 @@ -#include +#include +#include #include "korka/compiler/lexer.hpp" #include "korka/compiler/parser.hpp" #include