Skip to content

Commit

Permalink
fix(ci): debug => release
Browse files Browse the repository at this point in the history
  • Loading branch information
berdal84 committed Jan 13, 2025
1 parent edd9c0a commit 8b7f625
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,7 +35,7 @@ jobs:

- name: Install Dependencies
shell: bash
run: sudo rake install --trace
run: rake install --trace

- name: Build
shell: bash
Expand All @@ -43,4 +49,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: nodable-${{ runner.os }}
path: build-${{env.BUILD_TYPE}}/bin/
path: ./out/bin/
13 changes: 10 additions & 3 deletions rake/_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,38 @@
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."
elsif (not BUILD_OS_LINUX)
raise "Unable to determine the operating system"
end


#---------------------------------------------------------------------------

module TargetType
Expand Down
1 change: 0 additions & 1 deletion rake/ndbl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
1 change: 0 additions & 1 deletion rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8b7f625

Please sign in to comment.