Skip to content

Commit

Permalink
Set up CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Stachyra committed May 23, 2020
1 parent 38300ba commit b1b4f71
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 19 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Ruby Gem

on:
push:
tags:
- '*'

jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
version: 2.6.x

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Tests

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

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up cardano-wallet
run: docker-compose up --detach
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
with:
ruby-version: 2.6
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake
env:
CI: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
NETWORK: testnet
WALLET: dev-master-byron
NODE: latest
10 changes: 0 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@ source "https://rubygems.org"

# Specify your gem's dependencies in cardano_wallet.gemspec
gemspec

gem "httparty", "~> 0.18.0"

group :development, :test do
gem "rake", "~> 12.0"
gem "rspec", "~> 3.0"

gem 'codecov', require: false
gem 'simplecov', require: false
end
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<a href="https://github.com/piotr-iohk/cardano-wallet-rb/releases">
<img src="https://img.shields.io/github/release/piotr-iohk/cardano-wallet-rb.svg" />
</a>
<a href="https://codecov.io/gh/piotr-iohk/cardano-wallet-rb">
<img src="https://codecov.io/gh/piotr-iohk/cardano-wallet-rb/branch/master/graph/badge.svg?token=OmUMUeyR21" />
</a>
<a href="https://github.com/piotr-iohk/cardano-wallet-rb/actions?query=workflow%3ATests">
<img src="https://github.com/piotr-iohk/cardano-wallet-rb/workflows/Tests/badge.svg" />
</a>

# cardano-wallet-rb

Expand Down Expand Up @@ -67,13 +76,22 @@ Refer to documentation.

## Development

- Make sure tests are passing (`rake`)
- Develop and add tests
- Make sure tests are passing (`rake`)
In order to spin up environment for development and testing `docker-compose` can be used.

$ NETWORK=testnet WALLET=dev-master-byron NODE=latest docker-compose up --detach

This starts:
- `cardano-node` latest [release](https://github.com/input-output-hk/cardano-node/releases)
- `cardano-wallet-byron` [master](https://github.com/input-output-hk/cardano-wallet)

Run tests on top of that:

$ rake


## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/piotr-iohk/cardano-wallet-rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/piotr-iohk/cardano_wallet/blob/master/CODE_OF_CONDUCT.md).
Bug reports and pull requests are welcome on GitHub at https://github.com/piotr-iohk/cardano-wallet-rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/piotr-iohk/cardano-wallet-rb/blob/master/CODE_OF_CONDUCT.md).


## License
Expand All @@ -82,4 +100,4 @@ The gem is available as open source under the terms of the [MIT License](https:/

## Code of Conduct

Everyone interacting in the `cardano-wallet-rb` project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/piotr-iohk/cardano_wallet/blob/master/CODE_OF_CONDUCT.md).
Everyone interacting in the `cardano-wallet-rb` project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/piotr-iohk/cardano-wallet-rb/blob/master/CODE_OF_CONDUCT.md).
8 changes: 4 additions & 4 deletions cardano_wallet.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Gem::Specification.new do |spec|

spec.add_runtime_dependency 'httparty', '~> 0.18.0'

s.add_development_dependency 'rake', '~> 12.3'
s.add_development_dependency 'rspec', '~> 3.7'
s.add_development_dependency 'codecov'
s.add_development_dependency 'simplecov'
spec.add_development_dependency 'rake', '~> 12.3'
spec.add_development_dependency 'rspec', '~> 3.7'
spec.add_development_dependency 'codecov'
spec.add_development_dependency 'simplecov'

end
38 changes: 38 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: "3.5"

services:
cardano-node:
image: inputoutput/cardano-node:${NODE}
environment:
NETWORK:
volumes:
- node-${NETWORK}-db:/data
- node-ipc:/ipc
- node-config:/nix/store
restart: on-failure

cardano-wallet:
image: inputoutput/cardano-wallet:${WALLET}
volumes:
- wallet-${NETWORK}-db:/wallet-db
- node-ipc:/ipc
- node-config:/config
ports:
- 8090:8090
entrypoint: []
command: bash -c "
([[ $$NETWORK == \"mainnet\" ]] && $$CMD --mainnet) ||
([[ $$NETWORK == \"testnet\" ]] && $$CMD --testnet /config/*testnet-genesis.json)
"
environment:
CMD: "cardano-wallet-byron serve --node-socket /ipc/node.socket --database /wallet-db --listen-address 0.0.0.0"
NETWORK:
restart: on-failure

volumes:
node-mainnet-db:
node-testnet-db:
wallet-mainnet-db:
wallet-testnet-db:
node-ipc:
node-config:

0 comments on commit b1b4f71

Please sign in to comment.