Skip to content

Commit

Permalink
Merge pull request #34 from CedricCouton/github-actions
Browse files Browse the repository at this point in the history
GitHub actions
  • Loading branch information
giallon authored Sep 8, 2022
2 parents 5e54254 + b9cc913 commit 67603d9
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
strategy:
matrix:
gemfile: [ '7.0.0', '5.1.7' ]
ruby: [ '3.0', '2.7', '2.6']
exclude:
- ruby: '3.0'
gemfile: '5.1.7'
- ruby: '2.7'
gemfile: '5.1.7'
- ruby: '2.6'
gemfile: '7.0.0'
fail-fast: false
runs-on: ubuntu-18.04
name: ${{ matrix.ruby }} ${{ matrix.database }} rails-${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v2
- run: sudo apt-get update && sudo apt-get install libevent-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: sudo ./ci/run_couchbase.sh
- run: bundle exec rspec
env:
ACTIVE_MODEL_VERSION: ${{ matrix.gemfile }}
BUNDLE_JOBS: 4
BUNDLE_PATH: vendor/bundle
TRAVIS_TEST: true
RAILS_ENV: test
14 changes: 14 additions & 0 deletions ci/run_couchbase.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set -x
set -e
apt-get install libev-dev python-httplib2 libssl1.0.0
wget https://packages.couchbase.com/releases/5.1.0/couchbase-server-enterprise_5.1.0-ubuntu14.04_amd64.deb
dpkg -i couchbase-server-enterprise_5.1.0-ubuntu14.04_amd64.deb
sleep 8
sudo service couchbase-server status
/opt/couchbase/bin/couchbase-cli cluster-init -c 127.0.0.1:8091 --cluster-username=admin --cluster-password=password --cluster-ramsize=320 --cluster-index-ramsize=256 --cluster-fts-ramsize=256 --services=data,index,query,fts
sleep 5
/opt/couchbase/bin/couchbase-cli server-info -c 127.0.0.1:8091 -u admin -p password
/opt/couchbase/bin/couchbase-cli bucket-create -c 127.0.0.1:8091 -u admin -p password --bucket=default --bucket-type=couchbase --bucket-ramsize=160 --bucket-replica=0 --wait
sleep 1
/opt/couchbase/bin/couchbase-cli user-manage -c 127.0.0.1:8091 -u admin -p password --set --rbac-username tester --rbac-password password123 --rbac-name "Auto Tester" --roles admin --auth-domain local
curl http://admin:password@localhost:8093/query/service -d 'statement=CREATE INDEX `default_type` ON `default`(`type`)'
2 changes: 1 addition & 1 deletion couchbase-orm.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]

gem.add_runtime_dependency 'mt-libcouchbase', '~> 1.2'
gem.add_runtime_dependency 'activemodel', '>= 5.0'
gem.add_runtime_dependency 'activemodel', ENV["ACTIVE_MODEL_VERSION"] || '>= 5.0'
gem.add_runtime_dependency 'radix', '~> 2.2' # converting numbers to and from any base

gem.add_development_dependency 'rake', '~> 12.2'
Expand Down
2 changes: 1 addition & 1 deletion spec/views_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ViewTest < CouchbaseOrm::Base
it "should save a new design document" do
begin
ViewTest.bucket.delete_design_doc(ViewTest.design_document)
rescue Libcouchbase::Error::HttpResponseError
rescue MTLibcouchbase::Error::HttpResponseError
end
expect(ViewTest.ensure_design_document!).to be(true)
end
Expand Down

0 comments on commit 67603d9

Please sign in to comment.