File tree Expand file tree Collapse file tree 3 files changed +20
-15
lines changed
Expand file tree Collapse file tree 3 files changed +20
-15
lines changed Original file line number Diff line number Diff line change 7575 with :
7676 bundler-cache : false
7777
78- - name : Set up Rust
79- uses : dtolnay/rust-toolchain@stable
80- with :
81- toolchain : stable
82-
83- - name : Build CSS Parser
84- run : cd src/css && cargo build --release
85-
8678 - name : bundle install
8779 run : bundle install
8880
89- - name : Render Templates
90- run : bundle exec rake templates
91-
92- - name : Compile Herb
93- run : bundle exec rake make
94-
9581 - name : Build gem
9682 run : |
9783 if [ "${{ matrix.target }}" = "default" ]; then
Original file line number Diff line number Diff line change 6262 sh "bundle config set cache_all true"
6363
6464 PLATFORMS . each do |platform |
65- RakeCompilerDock . sh "bundle --local && rake native:#{ platform } gem" , platform : platform
65+ RakeCompilerDock . sh (
66+ "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && " \
67+ "source $HOME/.cargo/env && " \
68+ "bundle --local && rake native:#{ platform } gem" ,
69+ platform : platform
70+ )
6671 end
6772
6873 RakeCompilerDock . sh "bundle --local && rake java gem" , rubyvm : :jruby
95100 desc "Build the native gem for #{ platform } "
96101 task platform => "prepare" do
97102 RakeCompilerDock . sh (
103+ "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && " \
104+ "source $HOME/.cargo/env && " \
98105 "bundle --local && rake native:#{ platform } gem RUBY_CC_VERSION='#{ ENV . fetch ( "RUBY_CC_VERSION" , nil ) } '" ,
99106 platform : platform
100107 )
Original file line number Diff line number Diff line change 44
55Dir . chdir ( File . expand_path ( "../.." , __dir__ ) ) do
66 system ( "rake templates" , exception : true )
7+
8+ css_parser_path = "src/css"
9+ css_parser_lib = "#{ css_parser_path } /target/release/libherb_css_parser.a"
10+
11+ unless File . exist? ( css_parser_lib )
12+ puts "Building CSS parser with Rust..."
13+ unless system ( "cd #{ css_parser_path } && cargo build --release" )
14+ abort "Failed to build CSS parser. Make sure Rust and Cargo are installed."
15+ end
16+ else
17+ puts "CSS parser already built at #{ css_parser_lib } "
18+ end
719end
820
921extension_name = "herb"
You can’t perform that action at this time.
0 commit comments