Skip to content

Commit

Permalink
Add smoke test cross platform
Browse files Browse the repository at this point in the history
  • Loading branch information
robotdana committed Jul 11, 2023
1 parent beccf32 commit 34328e0
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,40 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: gem install syntax_suggest
timeout-minutes: 5
- run: bundle exec rspec spec --dry-run
timeout-minutes: 1
- run: bundle exec rspec spec --tag=~gitls
timeout-minutes: 5

compare:
strategy:
fail-fast: false
matrix:
repo:
- torvalds/linux
- rails/rails
- ruby/ruby
- facebook/react
runs-on: ubuntu-latest
platform: [ubuntu, windows, macos]
runs-on: ${{matrix.platform}}-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- run: ruby -e 'puts ::File.identical?(Dir.pwd, Dir.pwd.swapcase)'
- run: git clone --depth 1 https://github.com/${{ matrix.repo }}.git target
- run: cd target && ../bin/compare
timeout-minutes: 5
- if: matrix.platform == 'windows'
run: |
Set-Location target
ruby ..\bin\compare
# id: compare
timeout-minutes: 1
- if: matrix.platform != 'windows'
run: cd target && ../bin/compare
id: compare
timeout-minutes: 1
- run: cd target && ../bin/parse
if: failure() && steps.compare.outcome == 'failure'
- run: cd target && ../bin/ls
Expand All @@ -57,6 +68,7 @@ jobs:
if: failure() && steps.compare.outcome == 'failure'
- run: cd target && git ls-files --others --exclude-standard
if: failure() && steps.compare.outcome == 'failure'

coverage:
runs-on: ubuntu-latest
steps:
Expand All @@ -66,14 +78,16 @@ jobs:
ruby-version: '3.0'
bundler-cache: true
- run: gem install syntax_suggest
timeout-minutes: 5
- run: COVERAGE=1 bundle exec rspec

timeout-minutes: 5
- uses: actions/upload-artifact@v2
with:
name: coverage-report
path: 'coverage/*'
retention-days: 1
if: ${{ failure() }}
timeout-minutes: 5

rubocop:
runs-on: ubuntu-latest
Expand All @@ -84,7 +98,9 @@ jobs:
ruby-version: 3.2
bundler-cache: true
- run: gem install syntax_suggest
timeout-minutes: 5
- run: bundle exec rubocop
timeout-minutes: 5

spellr:
runs-on: ubuntu-latest
Expand All @@ -95,7 +111,9 @@ jobs:
ruby-version: 3.2
bundler-cache: true
- run: gem install syntax_suggest
timeout-minutes: 5
- run: bundle exec spellr
timeout-minutes: 1

leftovers:
runs-on: ubuntu-latest
Expand All @@ -106,7 +124,9 @@ jobs:
ruby-version: 3.2
bundler-cache: true
- run: gem install syntax_suggest
timeout-minutes: 5
- run: bundle exec leftovers
timeout-minutes: 1

build:
runs-on: ubuntu-latest
Expand All @@ -117,4 +137,6 @@ jobs:
ruby-version: 3.2
bundler-cache: true
- run: gem install syntax_suggest
timeout-minutes: 5
- run: bundle exec rake build
timeout-minutes: 1
1 change: 1 addition & 0 deletions .spellr_wordlists/english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ nocov
noninfringement
nosystem
ofo
ompare
oop
params
pathlist
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ platforms :ruby do
end

gem 'get_process_mem'
gem 'jruby-win32ole'
gem 'rspec', '~> 3.0'
gem 'syntax_suggest'
gem 'sys-proctable'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ GEM
jar-dependencies (0.4.1)
jaro_winkler (1.5.6)
jaro_winkler (1.5.6-java)
jruby-win32ole (0.8.5)
json (2.6.3)
json (2.6.3-java)
language_server-protocol (3.17.0.3)
Expand Down Expand Up @@ -136,6 +137,7 @@ DEPENDENCIES
commonmarker
debug
get_process_mem
jruby-win32ole
leftovers (>= 0.4.0)
path_list!
pry
Expand Down
2 changes: 2 additions & 0 deletions lib/path_list/candidate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ def full_path_downcase
# the containing directory as a Candidate,
# or nil if this is already the root
def parent
puts "@full_path: #{@full_path}"
return if @full_path == '/'

puts "::File.dirname(@full_path): #{::File.dirname(@full_path)}"
self.class.new(::File.dirname(@full_path), true)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Warning # leftovers:allow
$doing_include = false

require 'fileutils'
require 'get_process_mem'
require 'get_process_mem' if RUBY_PLATFORM != 'java'
FileUtils.rm_rf(File.join(__dir__, '..', 'coverage'))

require 'bundler/setup'
Expand All @@ -38,7 +38,7 @@ module Warning # leftovers:allow
end

config.before do
puts "Memory usage: #{GetProcessMem.new.mb}"
puts "Memory usage: #{GetProcessMem.new.mb}" if RUBY_PLATFORM != 'java'
Kernel.srand config.seed
stub_blank_global_config
allow(PathList::CanonicalPath).to receive(:case_insensitive?).and_return(false)
Expand Down

0 comments on commit 34328e0

Please sign in to comment.