diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..905067f1 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,27 @@ +name: windows + +on: [push, pull_request] + +jobs: + build: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + ruby: [ '9.9.x', '2.6.x', '2.5.x', '2.4.x' ] + steps: + - uses: actions/checkout@master + - name: Load Ruby, update gcc + uses: MSP-Greg/actions-ruby@master + with: + ruby-version: ${{ matrix.ruby }} + base: update + mingw: sqlite3 + - name: Install dependencies + run: | + gem update --system --no-document --conservative + bundle install --jobs 4 --retry 3 + - name: compile + run: rake compile:msys2 + - name: test + run: rake test diff --git a/rakelib/native.rake b/rakelib/native.rake index c5aea6df..f6d54900 100644 --- a/rakelib/native.rake +++ b/rakelib/native.rake @@ -51,6 +51,9 @@ RUBY_EXTENSION = Rake::ExtensionTask.new('sqlite3_native', HOE.spec) do |ext| end # ensure things are compiled prior testing -task :test => [:compile] - +if RUBY_PLATFORM =~ /mingw/ then + task :test => ["compile:msys2"] +else + task :test => [:compile] +end # vim: syntax=ruby diff --git a/rakelib/vendor_sqlite3.rake b/rakelib/vendor_sqlite3.rake index bb0df797..d8abc164 100644 --- a/rakelib/vendor_sqlite3.rake +++ b/rakelib/vendor_sqlite3.rake @@ -37,6 +37,17 @@ if RUBY_PLATFORM =~ /mingw/ # also prepend DevKit into compilation phase Rake::Task["compile"].prerequisites.unshift "devkit", "ports:sqlite3:#{RUBY_PLATFORM}" Rake::Task["native"].prerequisites.unshift "devkit", "ports:sqlite3:#{RUBY_PLATFORM}" + + namespace "compile" do + desc "Build using MSYS2 sqlite package" + task :msys2 do + RUBY_EXTENSION.config_options.pop + t = Rake::Task["compile"] + t.prerequisites.clear + t.prerequisites << "devkit" << "compile:#{RUBY_PLATFORM}" + t.invoke + end + end end # trick to test local compilation of sqlite3