Skip to content
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

GitHub action #31

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
37117b0
ADL version of shared_ptr
heckerpowered Aug 17, 2024
c461ad3
Add color
heckerpowered Aug 17, 2024
0e7c22b
Merge branch 'remove-shared' of https://github.com/heckerpowered/Jvav…
heckerpowered Aug 17, 2024
dc89cfd
简化Text相关类型
heckerpowered Aug 17, 2024
e82fcfb
初步简化代码逻辑
heckerpowered Aug 18, 2024
c1b580d
Update Jvav draft
heckerpowered Aug 19, 2024
92851c7
重构SyntaxTree
heckerpowered Aug 21, 2024
c8e087c
现代化
heckerpowered Aug 21, 2024
bed0d0f
移除shared_ptr
heckerpowered Aug 22, 2024
61a516a
完成Constant、移除Binding中的部分shared_ptr
heckerpowered Aug 23, 2024
6614ca3
修复:ScopeGuard错误地释放了声明的作用域
heckerpowered Aug 23, 2024
b211a3b
More modern
heckerpowered Aug 27, 2024
5dd795e
LLVM backend
heckerpowered Aug 27, 2024
adbfd05
修复bug & 完善诊断
heckerpowered Aug 28, 2024
a31a962
gcc-14 compact
heckerpowered Sep 7, 2024
fddba5b
Use rule instead of shell
heckerpowered Sep 12, 2024
f5b272a
Support CMake
heckerpowered Sep 12, 2024
40d6c5d
Remove unused includes
heckerpowered Sep 12, 2024
be01d82
Remove support of linker
heckerpowered Sep 12, 2024
4288143
Implement diagnostic printer
heckerpowered Sep 16, 2024
3a5f7ea
Add diagnostics
heckerpowered Sep 16, 2024
e60d351
remove unnecessary includes
heckerpowered Sep 20, 2024
2e35aab
Chinese Localization
heckerpowered Sep 20, 2024
b6b2415
Add support to CI builds for windows
heckerpowered Sep 20, 2024
88c195b
allow test github-actions in this branch
heckerpowered Sep 20, 2024
9694603
allow test github-actions in this branch
heckerpowered Sep 20, 2024
1130078
Skip scoop install
heckerpowered Sep 20, 2024
8b20a78
remove uncessary variable
heckerpowered Sep 20, 2024
1eceb39
尝试缓解找不到llvm-config的问题
heckerpowered Oct 2, 2024
052c781
Add support to linux
heckerpowered Oct 2, 2024
4a39084
try self-hosted runner
heckerpowered Oct 3, 2024
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
27 changes: 0 additions & 27 deletions .NET Linker.sln

This file was deleted.

5 changes: 3 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ BraceWrapping:
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
IndentBraces: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
Expand All @@ -82,7 +83,7 @@ BreakAdjacentStringLiterals: true
BreakAfterAttributes: Leave
# BreakAfterReturnType: Automatic
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: Allowed
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
Expand Down
73 changes: 68 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Publish to GitHub

on:
push:
branches: ["main"]
branches: ["main", "github-action"]
pull_request:
branches: ["main"]

jobs:
build:
build-macOS:
runs-on: macos-latest

steps:
Expand All @@ -25,17 +25,80 @@ jobs:
- name: Setup LLVM
run: brew install llvm

- name: Setup Environment Variables
run: echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> /Users/runner/.bash_profile

- name: Setup Build Script
if: ${{ runner.os != 'Windows' }}
run: chmod +x build.sh

- name: Build
run: |
xmake f -p macosx -a arm64 -m release
xmake -y

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Mamba
path: |
build/macosx/arm64/release/mamba

build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest

- name: Build
run: |
xmake f -p windows -a x64 -m release
xmake -y

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Mamba
path: |
build/windows/x64/release/mamba.exe

build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest

- name: Setup Homebrew
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

- name: Setup LLVM
run: brew install llvm

- name: Setup Environment Variables
run: echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> /Users/runner/.bash_profile

- name: Setup Build Script
if: ${{ runner.os != 'Windows' }}
run: chmod +x build.sh

- name: Build
run: ./build.sh
run: |
xmake f -p macosx -a arm64 -m release
xmake -y

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Mamba
path: |
build/macosx/arm64/release/Jvav
build/windows/x64/release/Jvav.exe
build/macosx/arm64/release/mamba
27 changes: 27 additions & 0 deletions .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish to GitHub (Self Hosted)

on:
push:
branches: ["main", "github-action"]
pull_request:
branches: ["main"]

jobs:
build-macOS:
runs-on: self-hosted

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: |
xmake f -p macosx -a arm64 -m release
xmake -y

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Mamba
path: |
build/macosx/arm64/release/mamba
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Jvav.xcodeproj/
CMakeFiles/
CMakeScripts/
cmake_install.cmake
CMakeLists.txt
CMakeCache.txt

src/.NET Linker/bin
Expand Down
39 changes: 39 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 3.22)
project(mamba)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()

include(FetchContent)
FetchContent_Declare(
fastio
URL https://github.com/Adttil/fast_io/archive/refs/heads/master.zip
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(fastio)

include_directories("include" "src/Mamba" "src/Mamba/Core" "src/Mamba/Code Analysis" "src/Mamba/Code Analysis/Syntax" "src/Mamba/Code Analysis/Text" "src/Mamba/Code Analysis/Binding" "src/Mamba/Code Analysis/Symbol" "src/Mamba/Code Generation")

set(CMAKE_EXE_LINKER_FLAGS "-static")

file(GLOB_RECURSE srcs "src/Mamba/**.cpp")
add_executable(mamba ${srcs})
target_link_libraries(mamba PRIVATE FAST_IO)

# LLVM Embedding
find_package(LLVM REQUIRED CONFIG)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

llvm_map_components_to_libnames(llvm_libs support core irreader)

target_link_libraries(mamba PRIVATE ${llvm_libs})

include_directories(${LLVM_INCLUDE_DIRS})
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS_LIST})
Loading
Loading