From 66ca90cec495a545638d65ca307dee35b382d322 Mon Sep 17 00:00:00 2001 From: skeshari12 Date: Tue, 12 Apr 2022 14:35:15 +0530 Subject: add ruby 3.1 in verfiy pipeline Signed-off-by: skeshari12 --- .expeditor/buildkite/run_linux_tests.sh | 14 ++++++ .expeditor/buildkite/run_windows_tests.ps1 | 20 ++++++++ .expeditor/buildkite/verify.ps1 | 20 ++++---- .expeditor/verify.pipeline.yml | 73 ++++++++++++++++-------------- 4 files changed, 82 insertions(+), 45 deletions(-) create mode 100755 .expeditor/buildkite/run_linux_tests.sh create mode 100644 .expeditor/buildkite/run_windows_tests.ps1 (limited to '.expeditor') diff --git a/.expeditor/buildkite/run_linux_tests.sh b/.expeditor/buildkite/run_linux_tests.sh new file mode 100755 index 0000000..3774734 --- /dev/null +++ b/.expeditor/buildkite/run_linux_tests.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# + +set -evx + +echo "---Bundle install---" +ruby --version +bundle --version +gem update --system +bundle install --without development_extras --jobs 3 --retry 3 --path vendor/bundle +gem install yajl-ruby json psych + +echo "---Bundle Exec---" +bundle exec rake \ No newline at end of file diff --git a/.expeditor/buildkite/run_windows_tests.ps1 b/.expeditor/buildkite/run_windows_tests.ps1 new file mode 100644 index 0000000..23f02c3 --- /dev/null +++ b/.expeditor/buildkite/run_windows_tests.ps1 @@ -0,0 +1,20 @@ +# Stop script execution when a non-terminating error occurs +$ErrorActionPreference = "Stop" + +# This will run ruby test on windows platform + +echo "--- Install make " +choco install make --source=cygwin + +Write-Output "--- Bundle install" +ruby --version +bundler --version +gem update --system +bundle install --without development_extras --jobs 3 --retry 3 --path vendor/bundle +gem install yajl-ruby json psych +If ($lastexitcode -ne 0) { Exit $lastexitcode } + +Write-Output "--- Bundle Execute" +bundle exec rake compile +bundle exec rake spec +If ($lastexitcode -ne 0) { Exit $lastexitcode } \ No newline at end of file diff --git a/.expeditor/buildkite/verify.ps1 b/.expeditor/buildkite/verify.ps1 index 106e1bf..c72188b 100644 --- a/.expeditor/buildkite/verify.ps1 +++ b/.expeditor/buildkite/verify.ps1 @@ -2,37 +2,37 @@ echo "--- system details" $Properties = 'Caption', 'CSName', 'Version', 'BuildType', 'OSArchitecture' Get-CimInstance Win32_OperatingSystem | Select-Object $Properties | Format-Table -AutoSize -echo "--- Install make and ruby2.devkit" -choco install make ruby ruby2.devkit -y +echo "--- Install make" +choco install make -y refreshenv - -echo - c:\tools\ruby26 > c:\tools\Devkit2\config.yml -ruby c:\tools\Devkit2\dk.rb install +If ($lastexitcode -ne 0) { Exit $lastexitcode } choco install msys2 -y refreshenv +If ($lastexitcode -ne 0) { Exit $lastexitcode } Write-Output 'Updating PATH' $env:PATH = "C:\tools\ruby26\bin;C:\tools\DevKit2\mingw\bin;C:\tools\DevKit2\bin;" + $env:PATH [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) +If ($lastexitcode -ne 0) { Exit $lastexitcode } ruby -v bundle --version gem -v - -C:\tools\ruby26\ridk_use\ridk.cmd install 3 -C:\tools\ruby26\ridk_use\ridk.cmd enable +If ($lastexitcode -ne 0) { Exit $lastexitcode } echo "--- gem install bundler" gem install bundler +If ($lastexitcode -ne 0) { Exit $lastexitcode } echo "--- bundle install" bundle install --without development_extras --jobs 3 --retry 3 --path vendor/bundle +If ($lastexitcode -ne 0) { Exit $lastexitcode } echo "+++ bundle exec rake compile" bundle exec rake compile +If ($lastexitcode -ne 0) { Exit $lastexitcode } echo "+++ bundle exec rake spec" bundle exec rake spec - -exit $LASTEXITCODE \ No newline at end of file +If ($lastexitcode -ne 0) { Exit $lastexitcode } \ No newline at end of file diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 06ca2f3..83ce300 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -3,12 +3,7 @@ steps: # Allow ruby-2.4 to softfail since it was configured so in travis too - label: ":ruby: 2.4" command: - - ruby --version - - bundle --version - - gem update --system - - bundle install --without development_extras --jobs 3 --retry 3 --path vendor/bundle - - gem install yajl-ruby json psych - - bundle exec rake + - .expeditor/buildkite/run_linux_tests.sh soft_fail: - exit_status: 1 expeditor: @@ -21,12 +16,7 @@ steps: - label: ":ruby: 2.5" command: - - ruby --version - - bundle --version - - gem update --system - - bundle install --without development_extras --jobs 3 --retry 3 --path vendor/bundle - - gem install yajl-ruby json psych - - bundle exec rake + - .expeditor/buildkite/run_linux_tests.sh expeditor: executor: docker: @@ -37,49 +27,62 @@ steps: - label: ":ruby: 2.6" command: - - ruby --version - - bundle --version - - gem update --system - - bundle install --without development_extras --jobs 3 --retry 3 --path vendor/bundle - - gem install yajl-ruby json psych - - bundle exec rake + - .expeditor/buildkite/run_linux_tests.sh expeditor: executor: docker: image: ruby:2.6 - privileged: true environment: - BUNDLE_GEMFILE=/workdir/Gemfile - FORCE_FFI_YAJL="ext" -# Allow jruby to softfail since it was configured so in travis too -- label: run-lint-and-specs-jruby +- label: ":ruby: 3.0" command: - - ruby --version - - bundle --version - - gem update --system - - apt-get update -y && apt-get install -y git make gcc - - bundle install --without development_extras --jobs 3 --retry 3 --path vendor/bundle - - gem install ffi json psych - - bundle exec rake - soft_fail: - - exit_status: 1 + - .expeditor/buildkite/run_linux_tests.sh expeditor: executor: docker: - image: jruby + image: ruby:3.0 + environment: + - BUNDLE_GEMFILE=/workdir/Gemfile + - FORCE_FFI_YAJL="ext" + +- label: ":ruby: 3.1" + command: + - .expeditor/buildkite/run_linux_tests.sh + expeditor: + executor: + docker: + image: ruby:3.1 privileged: true environment: - BUNDLE_GEMFILE=/workdir/Gemfile - - RUBY_PLATFORM="jruby" - - FORCE_FFI_YAJL="ffi" + - FORCE_FFI_YAJL="ext" + +- label: "run-specs-ruby-3.0-windows" + command: + - .expeditor/buildkite/run_windows_tests.ps1 + timeout_in_minutes: 20 + expeditor: + executor: + docker: + host_os: windows + shell: ["powershell", "-Command"] + image: rubydistros/windows-2019:3.0 + environment: + - BUNDLE_GEMFILE=/workdir/Gemfile + - FORCE_FFI_YAJL="ext" -- label: "run specs :windows:" +- label: "run-specs-ruby-3.1-windows" command: - - /workdir/.expeditor/buildkite/verify.ps1 + - .expeditor/buildkite/run_windows_tests.ps1 timeout_in_minutes: 20 expeditor: executor: docker: host_os: windows shell: ["powershell", "-Command"] + image: rubydistros/windows-2019:3.1 + environment: + - BUNDLE_GEMFILE=/workdir/Gemfile + - FORCE_FFI_YAJL="ext" -- cgit v1.2.1 From 2988001d6db3078119346964bb1ccae895520bf4 Mon Sep 17 00:00:00 2001 From: skeshari12 Date: Tue, 12 Apr 2022 18:04:45 +0530 Subject: add again spec for jruby Signed-off-by: skeshari12 --- .expeditor/buildkite/run_windows_tests.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '.expeditor') diff --git a/.expeditor/buildkite/run_windows_tests.ps1 b/.expeditor/buildkite/run_windows_tests.ps1 index 23f02c3..3e2277b 100644 --- a/.expeditor/buildkite/run_windows_tests.ps1 +++ b/.expeditor/buildkite/run_windows_tests.ps1 @@ -4,17 +4,21 @@ $ErrorActionPreference = "Stop" # This will run ruby test on windows platform echo "--- Install make " -choco install make --source=cygwin +choco install make --source=cygwin +If ($lastexitcode -ne 0) { Exit $lastexitcode } Write-Output "--- Bundle install" ruby --version bundler --version gem update --system +If ($lastexitcode -ne 0) { Exit $lastexitcode } bundle install --without development_extras --jobs 3 --retry 3 --path vendor/bundle +If ($lastexitcode -ne 0) { Exit $lastexitcode } gem install yajl-ruby json psych If ($lastexitcode -ne 0) { Exit $lastexitcode } Write-Output "--- Bundle Execute" bundle exec rake compile +If ($lastexitcode -ne 0) { Exit $lastexitcode } bundle exec rake spec If ($lastexitcode -ne 0) { Exit $lastexitcode } \ No newline at end of file -- cgit v1.2.1 From 164fca12782575349e76b024d1c880df57de1e3f Mon Sep 17 00:00:00 2001 From: "Marc A. Paradise" Date: Tue, 12 Apr 2022 11:58:45 -0400 Subject: Use build tools that are included with devkit These are in the devkit that is part of the base image and are guaranteed correct for native compilation of gems against these versions of ruby. Signed-off-by: Marc A. Paradise --- .expeditor/buildkite/run_windows_tests.ps1 | 44 +++++++++++++++++++++--------- .expeditor/verify.pipeline.yml | 4 +-- 2 files changed, 33 insertions(+), 15 deletions(-) (limited to '.expeditor') diff --git a/.expeditor/buildkite/run_windows_tests.ps1 b/.expeditor/buildkite/run_windows_tests.ps1 index 3e2277b..ed5c28a 100644 --- a/.expeditor/buildkite/run_windows_tests.ps1 +++ b/.expeditor/buildkite/run_windows_tests.ps1 @@ -1,24 +1,42 @@ -# Stop script execution when a non-terminating error occurs -$ErrorActionPreference = "Stop" +param([String]$version) +# This script will run ruby test on windows platform. It requires a version +# "3.0" or "3.1" as an argument. -# This will run ruby test on windows platform +# Stop script execution when a non-terminating error occurs. Note that this makes it +# unneccesary to check the exit code of each program being run - non-zero exit will force it to fail and terminate. +$ErrorActionPreference = "Stop" -echo "--- Install make " -choco install make --source=cygwin -If ($lastexitcode -ne 0) { Exit $lastexitcode } +# The specific paths of tools within the ruby30/31 devkit vary a bit across 3.0 and 3.1 +if ($version -eq "3.0") +{ + $base_dir = "C:\ruby30\" + $Env:PATH += ";" + $base_dir + "ruby\bin;" + $base_dir + "msys64\usr\bin;" + $base_dir + "msys64\mingw64\bin" +} +elseif($version -eq "3.1") +{ + $base_dir = "C:\ruby31\" + # Note path change - gcc is living in ucrt64\bin here, and mingw64 in earlier versions. + $Env:PATH += ";" + $base_dir + "ruby\bin;" + $base_dir + "msys64\usr\bin;" + $base_dir + "msys64\ucrt64\bin" +} -Write-Output "--- Bundle install" +Write-Output "--- Ensuring required bins are in path" +Write-Output "PATH: " + $Env:PATH +make --version +gcc --version ruby --version bundler --version + +Write-Output "--- Updating system gems" gem update --system -If ($lastexitcode -ne 0) { Exit $lastexitcode } + +Write-Output "--- Bundle install" bundle install --without development_extras --jobs 3 --retry 3 --path vendor/bundle -If ($lastexitcode -ne 0) { Exit $lastexitcode } + +Write-Output "--- Gem install" gem install yajl-ruby json psych -If ($lastexitcode -ne 0) { Exit $lastexitcode } -Write-Output "--- Bundle Execute" +Write-Output "--- Bundle Execute: rake compile" bundle exec rake compile -If ($lastexitcode -ne 0) { Exit $lastexitcode } + +Write-Output "--- Bundle Execute: rake spec" bundle exec rake spec -If ($lastexitcode -ne 0) { Exit $lastexitcode } \ No newline at end of file diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 83ce300..c105118 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -61,7 +61,7 @@ steps: - label: "run-specs-ruby-3.0-windows" command: - - .expeditor/buildkite/run_windows_tests.ps1 + - .expeditor/buildkite/run_windows_tests.ps1 "3.0" timeout_in_minutes: 20 expeditor: executor: @@ -75,7 +75,7 @@ steps: - label: "run-specs-ruby-3.1-windows" command: - - .expeditor/buildkite/run_windows_tests.ps1 + - .expeditor/buildkite/run_windows_tests.ps1 "3.1" timeout_in_minutes: 20 expeditor: executor: -- cgit v1.2.1 From 511ffa94c171fb96d0c232002c2bb67a155d4c67 Mon Sep 17 00:00:00 2001 From: "Marc A. Paradise" Date: Wed, 13 Apr 2022 11:26:23 -0400 Subject: make test names consistent Signed-off-by: Marc A. Paradise --- .expeditor/verify.pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.expeditor') diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index c105118..10b5e42 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -59,7 +59,7 @@ steps: - BUNDLE_GEMFILE=/workdir/Gemfile - FORCE_FFI_YAJL="ext" -- label: "run-specs-ruby-3.0-windows" +- label: ":windows: :ruby: 3.0" command: - .expeditor/buildkite/run_windows_tests.ps1 "3.0" timeout_in_minutes: 20 @@ -73,7 +73,7 @@ steps: - BUNDLE_GEMFILE=/workdir/Gemfile - FORCE_FFI_YAJL="ext" -- label: "run-specs-ruby-3.1-windows" +- label: ":windows: :ruby: 3.1" command: - .expeditor/buildkite/run_windows_tests.ps1 "3.1" timeout_in_minutes: 20 -- cgit v1.2.1