diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..96b8214 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,34 @@ +name: Meson Build and Deploy + +on: + push: + branches: ["lisp"] + pull_request: + +jobs: + build: + runs-on: home-1 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y meson ninja-build gcc + + - name: Configure Meson + run: meson setup build + + - name: Build project + run: meson compile -C build + + - name: Run tests + run: meson test -C build --print-errorlogs || true + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: beluga + path: build/ diff --git a/meson.build b/meson.build index 5018014..dcd91de 100644 --- a/meson.build +++ b/meson.build @@ -2,12 +2,12 @@ project('editor', 'c', version : '1.0.0', default_options : [ 'warning_level=2', - 'c_std=c99' ] ) # Check if we're using Clang and add Clang-specific options cc = meson.get_compiler('c') +m = cc.find_library('m', required: true) if cc.get_id() == 'clang' add_project_arguments([ '-Wextra', @@ -33,7 +33,7 @@ if cc.get_id() == 'clang' endif # Include directory -inc_dir = include_directories('include') +inc_dir = include_directories('include', 'lisp-interpreter/dist') # Source files src_files = files( @@ -45,12 +45,13 @@ src_files = files( 'src/input.c', 'src/output.c', 'src/row_op.c', - 'src/terminal.c' + 'src/terminal.c', ) # Executable executable('editor', src_files, include_directories : inc_dir, - install : true + install : true, + dependencies: [m] )