From 9291a99f9a16e1604e8a9e2990f3bdc3f920e451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 1 Jan 2020 21:39:16 +0100 Subject: Migrate Windows CI to Github actions --- .azure-pipelines/patch_readline.sh | 3 --- .azure-pipelines/rbreadline.diff | 41 -------------------------------------- .azure-pipelines/steps.yml | 33 ------------------------------ .github/workflows/windows.yml | 34 +++++++++++++++++++++++++++++++ azure-pipelines.yml | 18 ----------------- 5 files changed, 34 insertions(+), 95 deletions(-) delete mode 100644 .azure-pipelines/patch_readline.sh delete mode 100644 .azure-pipelines/rbreadline.diff delete mode 100644 .azure-pipelines/steps.yml create mode 100644 .github/workflows/windows.yml delete mode 100644 azure-pipelines.yml diff --git a/.azure-pipelines/patch_readline.sh b/.azure-pipelines/patch_readline.sh deleted file mode 100644 index 69bf661a1b..0000000000 --- a/.azure-pipelines/patch_readline.sh +++ /dev/null @@ -1,3 +0,0 @@ -ruby_version=$(ruby -e 'puts RUBY_VERSION') - -git apply --ignore-space-change --ignore-whitespace '.azure-pipelines\rbreadline.diff' --directory="C:/hostedtoolcache/windows/Ruby/$ruby_version/x64/lib/ruby/site_ruby" --unsafe-paths diff --git a/.azure-pipelines/rbreadline.diff b/.azure-pipelines/rbreadline.diff deleted file mode 100644 index c139577610..0000000000 --- a/.azure-pipelines/rbreadline.diff +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/rbreadline.rb b/rbreadline.rb -index c710961..e35408c 100644 ---- a/rbreadline.rb -+++ b/rbreadline.rb -@@ -16,6 +16,7 @@ end - - module RbReadline - require 'etc' -+ require 'io/console' - - RL_LIBRARY_VERSION = "5.2" - RL_READLINE_VERSION = 0x0502 -@@ -1092,6 +1093,9 @@ module RbReadline - @current_readline_init_include_level = 0 - @current_readline_init_lineno = 0 - -+ # Used in windows -+ @is_pipe = false -+ - ENV["HOME"] ||= "#{ENV["HOMEDRIVE"]}#{ENV["HOMEPATH"]}" - if !File.directory? ENV["HOME"] - raise RuntimeError.new("HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory") -@@ -4490,6 +4494,10 @@ module RbReadline - end - - def rl_getc(stream) -+ # below added as test for whether we're connected to a pipe or a keyboard. -+ # Pipe connection is probably running under a test suite. -+ return (stream.getc || EOF rescue EOF) if @is_pipe -+ - while (@kbhit.Call == 0) - # If there is no input, yield the processor for other threads - sleep(@_keyboard_input_timeout) -@@ -4740,6 +4748,7 @@ module RbReadline - def readline_internal_charloop() - lastc = -1 - eof_found = false -+ @is_pipe = (!@rl_outstream.winsize rescue true) - - while (!@rl_done) - lk = @_rl_last_command_was_kill diff --git a/.azure-pipelines/steps.yml b/.azure-pipelines/steps.yml deleted file mode 100644 index 50e13fb499..0000000000 --- a/.azure-pipelines/steps.yml +++ /dev/null @@ -1,33 +0,0 @@ -steps: - -- task: UseRubyVersion@0 - inputs: - versionSpec: '= 2.6' - -- script: | - ruby -v - ridk version - displayName: 'ruby -v + ridk version' - -- script: | - bash .azure-pipelines\patch_readline.sh - displayName: 'patch local readline implementation (for https://github.com/bundler/bundler/issues/6907)' - -- script: | - ruby bin/rake spec:deps - displayName: 'ruby bin/rake spec:deps' - -- script: | - gem install --no-document --conservative rspec_junit_formatter - displayName: 'gem install rspec_junit_formatter' - -- script: | - ruby -r rspec_junit_formatter bin/rspec --format RspecJunitFormatter -o rspec/bundler-junit-results.xml || exit 0 - displayName: 'ruby bin/rspec' - -- task: PublishTestResults@2 - inputs: - testRunner: JUnit - testResultsFiles: rspec/bundler-junit-results.xml - displayName: Publish test results - condition: succeededOrFailed() diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..f1538cff97 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,34 @@ +name: windows + +on: + pull_request: + + push: + branches: + - staging + - trying + +jobs: + windows: + runs-on: windows-latest + + strategy: + matrix: + ruby: [ '2.4.x', '2.5.x', '2.6.x' ] + + steps: + - uses: actions/checkout@v1 + + - name: Setup ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + + - name: Install dependencies + run: bin/rake spec:deps + shell: bash + + - name: Run specs + run: bin/rspec + shell: bash + continue-on-error: true diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 309e644487..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,18 +0,0 @@ -trigger: - branches: - include: - - master - - staging - - trying - - /.+-dev$/ - - /.+-stable$/ - -jobs: -- job: Windows - pool: - vmImage: 'vs2017-win2016' - variables: - rgv: v3.0.6 - steps: - - template: .azure-pipelines/steps.yml - timeoutInMinutes: 0 -- cgit v1.2.1