Skip to content

Commit bcb9e6c

Browse files
authored
Merge pull request #2 from i3abghany/ci
Implement a CI workflow
2 parents cbc3242 + eac84ec commit bcb9e6c

File tree

5 files changed

+59
-11
lines changed

5 files changed

+59
-11
lines changed

.github/workflows/run_tests.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
2+
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
3+
name: CMake on a single platform
4+
5+
on:
6+
push:
7+
branches: [ "main" ]
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
env:
12+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
13+
BUILD_TYPE: Release
14+
15+
jobs:
16+
build:
17+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
18+
# You can convert this to a matrix build if you need cross-platform coverage.
19+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install LLVM
26+
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 19 all
27+
28+
- name: Make a symbolic link to lli-19
29+
run: sudo ln -s /usr/bin/lli-19 /usr/bin/lli
30+
31+
- name: Install Prerequisites
32+
run: sudo apt update && sudo apt install libboost1.74-all-dev default-jre libfmt-dev -y
33+
34+
- name: Download ANTLR4.13.2
35+
run: wget https://www.antlr.org/download/antlr-4.13.2-complete.jar -O ${{github.workspace}}/antlr-4.13.2-complete.jar && chmod +x ${{github.workspace}}/antlr-4.13.2-complete.jar
36+
37+
- name: print java version
38+
run: java --version
39+
40+
- name: Configure CMake
41+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
42+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
43+
run: export PATH="${{github.workspace}}:$PATH" && echo $PATH && cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
44+
45+
- name: Build
46+
# Build your program with the given configuration
47+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
48+
49+
- name: Test
50+
working-directory: ${{github.workspace}}/build
51+
# Execute tests defined by the CMake configuration.
52+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
53+
run: ./ktest
54+

CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ find_package(fmt CONFIG REQUIRED)
1717
include_directories(${PROJECT_SOURCE_DIR}/include)
1818
include_directories(${ANTLR4_INCLUDE_DIRS})
1919

20-
set(CMAKE_CXX_COMPILER "clang++-20")
21-
add_compile_options(-fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer)
22-
add_link_options(-fsanitize=address -fsanitize=undefined)
23-
2420
set(SOURCES
2521
src/Visitor.cpp
2622
src/AST/ASTNode.cpp

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the repository for the Kyoto Compiler for the Kyoto Programming Language
66

77
The Kyoto Compiler requires the following dependencies:
88

9-
- LLVM >= 20
9+
- LLVM >= 19
1010
- CMake >= 3.20
1111
- antlr >= 4.13.2
1212
- Boost >= 1.74.0

include/kyoto/Analysis/FunctionTermination.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "llvm/IR/Analysis.h"
3+
// #include "llvm/IR/Analysis.h"
44
#include "llvm/IR/PassManager.h"
55

66
class ModuleCompiler;
@@ -21,4 +21,4 @@ struct FunctionTerminationPass : public llvm::PassInfoMixin<FunctionTerminationP
2121

2222
private:
2323
ModuleCompiler& compiler;
24-
};
24+
};

test/TestDriver.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#include <gtest/gtest-message.h>
2-
#include <gtest/gtest-test-part.h>
3-
#include <gtest/gtest_pred_impl.h>
1+
#include <gtest/gtest.h>
42
#include <optional>
53
#include <stdint.h>
64
#include <string>
@@ -29,4 +27,4 @@ void test_driver(const utils::TestCase& test_case)
2927
}
3028
}
3129

32-
}
30+
}

0 commit comments

Comments
 (0)