Skip to content

Commit

Permalink
Merge pull request #234 from locomotivecms/replace-travis-gh-actions
Browse files Browse the repository at this point in the history
replace Travis CI by Github actions
  • Loading branch information
did authored Apr 1, 2024
2 parents e843a9e + 820d95e commit 114b7ef
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 23 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Continuous integration

on: [push]

jobs:
ci_validation:
runs-on: ubuntu-latest

services:
mongo:
image: mongo:6.0.14
ports:
- 27017:27017
env:
MONGO_INITDB_DATABASE: steam_test_1_8_x
options: >-
--health-cmd "echo 'db.runCommand("ping").ok' | mongosh --quiet"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name mongo_container
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install MongoDB tools
run: |
wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.9.4.deb
sudo apt install ./mongodb-database-tools-ubuntu2204-x86_64-100.9.4.deb
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.4
bundler-cache: true
cache-version: 1

- name: Prepare the DB
run: bundle exec rake mongodb:test:seed

- name: Test
run: bundle exec rspec
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 NoCoffee
Copyright (c) 2010-2024 NoCoffee

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Steam

[![Code Climate](https://codeclimate.com/github/locomotivecms/steam/badges/gpa.svg)](https://codeclimate.com/github/locomotivecms/steam) [![Build Status](https://travis-ci.com/locomotivecms/steam.svg?branch=master)](https://travis-ci.com/locomotivecms/steam) [![Coverage Status](https://coveralls.io/repos/locomotivecms/steam/badge.svg?branch=master)](https://coveralls.io/r/locomotivecms/steam?branch=master) [![Gitter](https://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)](https://gitter.im/locomotivecms/steam)

The rendering stack used by both Wagon and Engine. It includes:

- the rack stack to pages and already precompiled assets (through webpack, vite or other).
Expand Down Expand Up @@ -103,4 +101,4 @@ Note: you do not need to prefix with bundle exec as the docky-ruby image already

## License

Copyright (c) 2023 NoCoffee. MIT Licensed, see MIT-LICENSE for details.
Copyright (c) 2010-2024 NoCoffee. MIT Licensed, see MIT-LICENSE for details.
6 changes: 4 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ namespace :mongodb do
`mv #{dump_path} #{db_path}`
end

`mongo steam_test_1_7_x --eval "db.dropDatabase()" #{host}`
`mongorestore -d steam_test_1_7_x #{db_path} #{host}`
# NOTE: command to drop the database
# `mongo steam_test_1_8_x --eval "db.dropDatabase()" #{host}`

`mongorestore --drop -d steam_test_1_8_x #{db_path} #{host}`

puts "Done! Update now the spec/support/helpers.rb file by setting the new id of the site returned by the mongodb_site_id method"
end
Expand Down
5 changes: 0 additions & 5 deletions script/ci/before_build.sh

This file was deleted.

3 changes: 2 additions & 1 deletion spec/integration/adapters/mongodb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
end

def current_connections
`mongosh --eval "db.serverStatus().connections.current"`.split("\n").last.to_i
stats = JSON.parse(`mongostat --noheaders -n 1 --json`)
stats.dig('localhost', 'conn')&.to_i
end

end
2 changes: 1 addition & 1 deletion spec/support/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Spec
module Helpers

def mongodb_database
'steam_test_1_7_x'
'steam_test_1_8_x'
end

def mongodb_site_id
Expand Down

0 comments on commit 114b7ef

Please sign in to comment.