Skip to content

Commit

Permalink
introduced checkout list
Browse files Browse the repository at this point in the history
  • Loading branch information
taichi-ishitani committed Feb 23, 2020
1 parent 51258d8 commit 9708da3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 42 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
frozen_string_literal: 'yes'

env:
RGGEN_ROOT: ${{ github.workspace }}
RUBYOPT: ${{ (matrix.frozen_string_literal == 'yes' && '--enable-frozen-string-literal') || '' }}
USE_FIXED_GEMS: ${{ matrix.frozen_string_literal }}
RGGEN_SAMPLE_DIRECTORY: ${{ github.workspace }}/rggen-sample

steps:
- uses: actions/checkout@v2
Expand All @@ -29,6 +29,16 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}

- name: Checkout RgGen library list
uses: actions/checkout@v2
with:
repository: rggen/rggen-checkout
path: rggen-checkout

- name: Checkout RgGen libraries
run: |
${RGGEN_ROOT}/rggen-checkout/bin/checkout
- name: Cache gems
uses: actions/cache@v1
with:
Expand All @@ -43,19 +53,6 @@ jobs:
bundle config path vendor/bundle
bundle install
- name: Cache samples
uses: actions/cache@v1
with:
path: rggen-sample
key: samples-${{ runner.os }}-${{ matrix.ruby }}-frozen_string_literal-${{ matrix.frozen_string_literal }}-${{ github.sha }}
restore-keys: |
samples-${{ runner.os }}-${{ matrix.ruby }}-frozen_string_literal-${{ matrix.frozen_string_literal }}-
- name: Get samples
run: |
[ -d rggen-sample ] || git clone https://github.com/rggen/rggen-sample.git
cd rggen-sample; git pull
- name: Run RSpec
run: |
bundle exec rake coverage
Expand Down Expand Up @@ -86,7 +83,7 @@ jobs:
- name: Install gems
run: |
bundle config path vendor/bundle
bundle config set with develop
bundle config set without rggen test
bundle install
- name: Run Rubocop
Expand Down
41 changes: 16 additions & 25 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,25 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in rggen.gemspec
gemspec

[
'rggen-devtools',
'rggen-core',
'rggen-default-register-map',
'rggen-markdown',
'rggen-spreadsheet-loader',
'rggen-systemverilog'
].each do |rggen_library|
library_path = File.expand_path("../#{rggen_library}", __dir__)
if Dir.exist?(library_path) && !ENV['USE_GITHUB_REPOSITORY']
gem rggen_library, path: library_path
else
gem rggen_library, git: "https://github.com/rggen/#{rggen_library}.git"
end
end
group :rggen do
rggen_root = ENV['RGGEN_ROOT'] || File.expand_path('..', __dir__)
gemfile_path = File.join(rggen_root, 'rggen-checkout', 'Gemfile')
File.exist?(gemfile_path) &&
instance_eval(File.read(gemfile_path), gemfile_path, 1)

if ENV['USE_FIXED_GEMS']
['facets', 'rubyzip'].each do |library|
library_path = File.expand_path("../#{library}", __dir__)
if Dir.exist?(library_path) && !ENV['USE_GITHUB_REPOSITORY']
gem library, path: library_path
else
gem library, git: "https://github.com/taichi-ishitani/#{library}.git"
if ENV['USE_FIXED_GEMS'] == 'yes'
['facets', 'rubyzip'].each do |library|
library_path = File.expand_path("../#{library}", __dir__)
if Dir.exist?(library_path) && !ENV['USE_GITHUB_REPOSITORY']
gem library, path: library_path
else
gem library, git: "https://github.com/taichi-ishitani/#{library}.git"
end
end
end

gem 'ruby-ole', '>= 1.2.12.2'
gem 'spreadsheet', '>= 1.2.1'
gem 'ruby-ole', '>= 1.2.12.2'
gem 'spreadsheet', '>= 1.2.1'
end
end

group :develop do
Expand Down
10 changes: 8 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
require 'rggen/devtools/spec_helper'

RSpec.configure do |config|
RgGen::Devtools::SpecHelper.setup(config)
RgGen::Devtools::SpecHelper.setup(
config,
coverage_filter: [/rggen-/]
)
end

RGGEN_SAMPLE_DIRECTORY =
ENV['RGGEN_SAMPLE_DIRECTORY'] || '../rggen-sample'
File.join(
ENV['RGGEN_ROOT'] || File.expand_path('../..', __dir__),
'rggen-sample'
)

0 comments on commit 9708da3

Please sign in to comment.