Skip to content

Commit

Permalink
ci: Use ENABLE_GITHUB_ACTIONS_MARKUP instead of GITHUB_ACTIONS
Browse files Browse the repository at this point in the history
To avoid CRuby's configure script to use nested groups, which is not
supported by GitHub Actions yet.
  • Loading branch information
kateinoigakukun committed Nov 15, 2023
1 parent cbf3bad commit fc66f9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
run: rake ${{ matrix.entry.prerelease }}[${{ inputs.prerel_name }}]
if: ${{ inputs.prerel_name != '' && matrix.entry.prerelease != '' }}
- name: rake ${{ matrix.entry.task }}
run: docker run -v "$GITHUB_WORKSPACE:/home/me/build" -w /home/me/build -e "GITHUB_ACTIONS=$GITHUB_ACTIONS" -e "RUBYWASM_UID=$(id -u)" -e "RUBYWASM_GID=$(id -g)" -e "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" ${{ steps.builder-image.outputs.imageid }} rake --verbose ${{ matrix.entry.task }}
run: docker run -v "$GITHUB_WORKSPACE:/home/me/build" -w /home/me/build -e "ENABLE_GITHUB_ACTIONS_MARKUP=true" -e "RUBYWASM_UID=$(id -u)" -e "RUBYWASM_GID=$(id -g)" -e "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" ${{ steps.builder-image.outputs.imageid }} rake --verbose ${{ matrix.entry.task }}
- name: rake ${{ matrix.entry.test }}
run: rake ${{ matrix.entry.test }}
if: ${{ matrix.entry.test != '' }}
Expand Down
5 changes: 3 additions & 2 deletions lib/ruby_wasm/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module RubyWasm
class BuildExecutor
def initialize(verbose: false)
@verbose = verbose
@github_actions_markup = ENV["ENABLE_GITHUB_ACTIONS_MARKUP"] != nil
end

def system(*args, chdir: nil, out: nil, env: nil)
Expand Down Expand Up @@ -42,7 +43,7 @@ def system(*args, chdir: nil, out: nil, env: nil)

def begin_section(klass, name, note)
message = "\e[1;36m==>\e[0m \e[1m#{klass}(#{name}) -- #{note}\e[0m"
if ENV["GITHUB_ACTIONS"]
if @github_actions_markup
puts "::group::#{message}"
else
puts message
Expand All @@ -57,7 +58,7 @@ def begin_section(klass, name, note)

def end_section(klass, name)
took = Time.now - @start_times[[klass, name]]
if ENV["GITHUB_ACTIONS"]
if @github_actions_markup
puts "::endgroup::"
end
puts "\e[1;36m==>\e[0m \e[1m#{klass}(#{name}) -- done in #{took.round(2)}s\e[0m"
Expand Down
1 change: 1 addition & 0 deletions sig/ruby_wasm/build.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ module RubyWasm

class BuildExecutor
@verbose: bool
@github_actions_markup: bool
@start_times: Hash[[Class, String], Time]

def initialize: (?verbose: bool) -> void
Expand Down

0 comments on commit fc66f9f

Please sign in to comment.