From ecafacd268d4db13af5ab37141391fd90f4c1e33 Mon Sep 17 00:00:00 2001 From: mvenditto Date: Thu, 15 Jun 2023 19:57:15 +0100 Subject: [PATCH] mapping, csharp-workflow and first attempt to build on Linux --- .circleci/config.yml | 1 + .circleci/continue_config.yml | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index bdaf4486..dc76e62f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,7 @@ workflows: config-path: .circleci/continue_config.yml mapping: | gpt4all-bindings/python/.* run-python-workflow true + gpt4all-bindings/csharp/.* run-csharp-workflow true gpt4all-backend/.* run-chat-workflow true gpt4all-chat/.* run-chat-workflow true .* run-default-workflow true diff --git a/.circleci/continue_config.yml b/.circleci/continue_config.yml index 68571580..c688de57 100644 --- a/.circleci/continue_config.yml +++ b/.circleci/continue_config.yml @@ -13,6 +13,9 @@ parameters: run-chat-workflow: type: boolean default: false + run-csharp-workflow: + type: boolean + default: false jobs: default-job: @@ -306,6 +309,46 @@ jobs: - store_artifacts: path: /tmp/workspace + build-csharp-linux: + working_directory: ~/gpt4all-bindings/csharp + docker: + - image: mcr.microsoft.com/dotnet/sdk:6.0-jammy # Ubuntu 22.04 + steps: + - checkout + - restore_cache: + keys: + - gpt4all-csharp-bindings + - run: + name: Install dependencies + command: | + sudo apt-get update + sudo apt-get install -y cmake build-essential + - run: + name: Build C library + command: | + git submodule init + git submodule update + ./build_linux.sh + - run: + name: "Install project dependencies" + command: | + dotnet.exe restore Gpt4All + - save_cache: + paths: + - ~/.nuget/packages + key: gpt4all-csharp-bindings + - run: + name: "Run C# Tests" + command: | + dotnet.exe test -v n --filter --filter SKIP_ON_CI=False + - run: + name: Build C# Project + command: | + dotnet build Gpt4All --configuration Release + - persist_to_workspace: + root: gpt4all-bindings/csharp/runtimes/linux-x64/native + paths: + - "gpt4all-bindings/csharp/runtimes/linux-x64/native/*.so" workflows: version: 2 default: @@ -366,3 +409,14 @@ workflows: - build-py-windows - build-py-linux - build-py-macos + build-csharp-deploy: + when: << pipeline.parameters.run-csharp-workflow >> + jobs: + - nuget-hold: + type: approval + - hold: + type: approval + - build-csharp-linux: + filters: + branches: + only: \ No newline at end of file