Skip to content

Commit 5f28088

Browse files
committed
Introduce AppVeyor CI for Windows
The included configuration aims to compile and test builds of sqlite3-ruby gem against a native Windows environment provided by AppVeyor platform. Add `devkit` task that prepends both compile and native ones and ensures RubyInstaller's DevKit is enabled in the PATH prior compilation.
1 parent e81a3db commit 5f28088

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

appveyor.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
version: "{build}"
3+
branches:
4+
only:
5+
- master
6+
- 1-3-stable
7+
clone_depth: 10
8+
install:
9+
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
10+
- ruby --version
11+
- gem --version
12+
- gem install bundler --quiet --no-ri --no-rdoc
13+
- bundler --version
14+
- bundle install
15+
build_script:
16+
- rake native gem
17+
test_script:
18+
- rake test
19+
artifacts:
20+
- path: pkg\*.gem
21+
22+
environment:
23+
matrix:
24+
- ruby_version: "193"
25+
- ruby_version: "200"
26+
- ruby_version: "200-x64"

tasks/native.rake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ BINARY_VERSION = "3.7.17"
99
URL_VERSION = "3071700"
1010
URL_PATH = "/2013"
1111

12+
# prepend DevKit into compilation phase
13+
if RUBY_PLATFORM =~ /mingw/
14+
task :compile => [:devkit]
15+
task :native => [:devkit]
16+
end
17+
18+
task :devkit do
19+
begin
20+
require "devkit"
21+
rescue LoadError => e
22+
abort "Failed to activate RubyInstaller's DevKit required for compilation."
23+
end
24+
end
25+
1226
# build sqlite3_native C extension
1327
RUBY_EXTENSION = Rake::ExtensionTask.new('sqlite3_native', HOE.spec) do |ext|
1428
# where to locate the extension

0 commit comments

Comments
 (0)