diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 527784af4..0756a536d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,10 +12,16 @@ on: jobs: build: + strategy: + matrix: + build_target: [desktop] + build_type: [release] runs-on: [ubuntu-22.04] env: # Those are read by rake script - BUILD_TYPE: debug # release|debug + BUILD_TYPE: ${{ matrix.build_type }} # release|debug + BUILD_TARGET: ${{ matrix.build_target }} # dektop|web + BUILD_DIR: ./out VERBOSE: true steps: - name: Git Checkout @@ -29,7 +35,7 @@ jobs: - name: Install Dependencies shell: bash - run: sudo rake install --trace + run: rake install --trace - name: Build shell: bash @@ -43,4 +49,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: nodable-${{ runner.os }} - path: build-${{env.BUILD_TYPE}}/bin/ \ No newline at end of file + path: ./out/bin/ \ No newline at end of file diff --git a/rake/_utils.rb b/rake/_utils.rb index d2af423ef..4a38ecb6f 100644 --- a/rake/_utils.rb +++ b/rake/_utils.rb @@ -6,24 +6,30 @@ CXX_COMPILER = "clang++-15" BUILD_OS = RbConfig::CONFIG['build_os'] HOST_OS = RbConfig::CONFIG['host_os'] -TARGET_OS = RbConfig::CONFIG['target_os'] +BUILD_TARGET = (ENV["BUILD_TARGET"] || "desktop").downcase BUILD_TYPE = (ENV["BUILD_TYPE"] || "release").downcase BUILD_TYPE_RELEASE = BUILD_TYPE == "release" -BUILD_TYPE_DEBUG = !BUILD_TYPE_RELEASE -BUILD_DIR = ENV["BUILD_DIR"] || "build-#{BUILD_TYPE}" +BUILD_TYPE_DEBUG = BUILD_TYPE != "release" +BUILD_DIR = ENV["BUILD_DIR"] || "build-#{BUILD_TARGET}-#{BUILD_TYPE}" OBJ_DIR = "#{BUILD_DIR}/obj" DEP_DIR = "#{BUILD_DIR}/dep" BIN_DIR = "#{BUILD_DIR}/bin" BUILD_OS_LINUX = BUILD_OS.include?("linux") GITHUB_ACTIONS = ENV["GITHUB_ACTIONS"] +if BUILD_TARGET != "desktop" && BUILD_TARGET != "web" + raise "Unexpected value for TARGET, use desktop|web"; +end + if VERBOSE system "echo Ruby version: && ruby -v" puts "BUILD_OS_LINUX: #{BUILD_OS_LINUX}" + puts "BUILD_TARGET: #{BUILD_TARGET}" puts "COMPILER_FOUND: #{COMPILER_FOUND}" puts "BUILD_TYPE_RELEASE: #{BUILD_TYPE_RELEASE}" puts "BUILD_TYPE_DEBUG: #{BUILD_TYPE_DEBUG}" end + COMPILER_FOUND = system "#{C_COMPILER} --version" || false if not COMPILER_FOUND raise "Unable to find #{C_COMPILER} from path." @@ -31,6 +37,7 @@ raise "Unable to determine the operating system" end + #--------------------------------------------------------------------------- module TargetType diff --git a/rake/ndbl.rb b/rake/ndbl.rb index dd1b60d61..9aacfef57 100644 --- a/rake/ndbl.rb +++ b/rake/ndbl.rb @@ -92,7 +92,6 @@ task :rebuild => ['clean', 'build'] task :build => ['core:build', 'gui:build', 'app:build', 'test:build'] task :test => ['test:run'] - task :pack => ['app:pack'] namespace :core do tasks_for_target( ndbl_core ) diff --git a/rakefile b/rakefile index 0b114017b..afad5f1c4 100644 --- a/rakefile +++ b/rakefile @@ -20,4 +20,3 @@ end task :install => ['libs:install'] do puts "Install Libs DONE" end task :build => ['tools:build', 'ndbl:build'] do puts "Build DONE" end task :test => ['tools:test', 'ndbl:test'] -task :pack => ['ndbl:pack'] do puts "Pack DONE" end