From f4d0f35bdeac2579ec02387f8153dbee25be766d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sun, 12 Apr 2020 14:33:20 +0200 Subject: [PATCH] Migrate Windows CI to Github Actions I needed to workaround one test because on the Github Actions environment, the test path is not the last feature to have been loaded. The test is only concerned with it having been loaded, no matter in which position, so adapt the assertion. --- .github/workflows/windows.yml | 62 +++++++++++++++++++++++ appveyor.yml | 59 --------------------- test/runner_against_valid_program_test.rb | 2 +- 3 files changed, 63 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/windows.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..0ff276b70 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,62 @@ +--- + +name: windows + +on: + pull_request: + + push: + branches: + - master + +jobs: + test: + runs-on: windows-2019 + + strategy: + matrix: + version: [2.4.9, 2.5.7, 2.6.5, head] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v1 + with: + path: .bundle + key: gems-${{ hashFiles('**/Gemfile.lock') }} + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.version }} + + - name: Clone patched rb-readline + shell: cmd + run: git clone -q --depth=5 --no-tags --branch=byebug https://github.com/deivid-rodriguez/rb-readline.git C:\rb-readline + + - name: Install patched rb-readline + run: | + $env:n_dir = (&ruby.exe -e "puts RbConfig::CONFIG['sitelibdir']" | Out-String).Trim() + Copy-Item -Path C:\rb-readline\lib\readline.rb -Destination $env:n_dir\readline.rb + Copy-Item -Path C:\rb-readline\lib\rbreadline.rb -Destination $env:n_dir\rbreadline.rb + + - name: Display environment information + shell: cmd + run: | + echo %PATH% + + ruby --version + where ruby + + gem --version + where gem + + bash --version + where bash + + - name: Setup dependencies + shell: bash + run: bin/setup.sh + + - name: Run tests + run: ruby bin/rake compile test + continue-on-error: ${{ matrix.version == 'head' }} diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 2e0151b61..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- - -install: - - set PATH=C:\Ruby%ruby_version%\bin;C:\Program Files\Git\cmd;C:/Windows/system32;C:\Program Files\Git\usr\bin - - - ps: | - if ($env:ruby_version -like "*head*") { - $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-$env:ruby_version.exe", "$pwd/ruby-setup.exe") - cmd /c ruby-setup.exe /verysilent /dir=C:/Ruby$env:ruby_version - } - - - git clone -q --depth=5 --no-tags --branch=byebug https://github.com/deivid-rodriguez/rb-readline.git C:\rb-readline - - - ps: | - $env:n_dir = (&ruby.exe -e "puts RbConfig::CONFIG['sitelibdir']" | Out-String).Trim() - Copy-Item -Path C:\rb-readline\lib\readline.rb -Destination $env:n_dir\readline.rb - Copy-Item -Path C:\rb-readline\lib\rbreadline.rb -Destination $env:n_dir\rbreadline.rb - - - echo %PATH% - - - ruby --version - - where ruby - - - gem --version - - where gem - - - bash --version - - where bash - -build_script: - - bash -lc bin/setup.sh - -test_script: - - ruby bin/rake compile test - -environment: - matrix: - - ruby_version: 24-x64 - - ruby_version: 25-x64 - - ruby_version: 26-x64 - - ruby_version: head-x64 - -cache: - - .bundle - -matrix: - allow_failures: - - ruby_version: head-x64 - -branches: - only: - - master - -notifications: - - provider: Email - - on_build_success: false - on_build_failure: false - on_build_status_changed: true diff --git a/test/runner_against_valid_program_test.rb b/test/runner_against_valid_program_test.rb index fead3f712..9555ccfba 100644 --- a/test/runner_against_valid_program_test.rb +++ b/test/runner_against_valid_program_test.rb @@ -84,7 +84,7 @@ def test_run_with_require_flag stdout = run_byebug( "-r", example_path, example_path, input: \ - "puts \"Example path loaded? \#{$LOADED_FEATURES.last == '#{example_path}'}\"" + "puts \"Example path loaded? \#{$LOADED_FEATURES.include?('#{example_path}')}\"" ) assert_match(/Example path loaded\? true/, stdout)