Skip to content

Commit

Permalink
CI build using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mmateja committed May 17, 2020
1 parent b0b3211 commit 78a14dc
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 113 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build

on: [push]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.4', '2.5', '2.6', '2.7']
steps:
- uses: actions/checkout@v2
- name: Setup Ruby ${{ matrix.ruby }}
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Rubocop
run: rake rubocop
- name: Unit tests
env:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: key_id
AWS_SECRET_ACCESS_KEY: secret_key
run: rake spec:unit
- name: Integration tests
env:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: rake spec:integration
publish:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Bundle
id: bundle
run: |
gem build egis.gemspec --output=bundle.gem
gem specification bundle.gem version --yaml | ruby -e "require 'yaml'; puts \"::set-output name=version::#{YAML.load(ARGF)}\""
gem query --remote --quiet --exact egis | ruby -e "puts \"::set-output name=rubygems-version::#{/egis \((.+?)\)/.match(ARGF.read)[1]}\""
- name: Print versions
run: |
echo "RubyGems version: ${{ steps.bundle.outputs.rubygems-version }}"
echo "Build version: ${{ steps.bundle.outputs.version }}"
- name: Publish
if: github.ref == 'refs/heads/master' && steps.bundle.outputs.version != steps.bundle.outputs.rubygems-version
env:
GEM_HOST_API_KEY: ${{ secrets.U2I_RUBY_GEMS_API_ACCESS_KEY }}
run: gem push bundle.gem
2 changes: 2 additions & 0 deletions docker/ruby-2.7/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ RUN bundle install
COPY . .

ENTRYPOINT ["/usr/bin/dumb-init", "--"]

CMD ["rake"]
79 changes: 0 additions & 79 deletions Jenkinsfile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Gem Version](https://badge.fury.io/rb/egis.svg)](https://badge.fury.io/rb/egis)
[![Build Status](http://jenkins-ci.talkwit.tv/buildStatus/icon?job=u2i/egis/master)](http://jenkins-ci.talkwit.tv/job/u2i/egis/master)
[Build Status](https://github.com/u2i/egis/workflows/Build/badge.svg?branch=master)

# Egis

Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ end

namespace :spec do
RSpec::Core::RakeTask.new(:unit) do |task|
task.rspec_opts = '--tag ~integration'
task.pattern = 'spec/unit/**/*.rb'
end

RSpec::Core::RakeTask.new(:integration) do |task|
task.rspec_opts = '--tag integration'
task.pattern = 'spec/integration/**/*.rb'
end
end

Expand Down
14 changes: 0 additions & 14 deletions docker/ruby-2.5/Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions docker/ruby-2.6/Dockerfile

This file was deleted.

6 changes: 3 additions & 3 deletions spec/integration/egis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

require 'spec_helper'

RSpec.describe 'Integration with AWS Athena', integration: true do
RSpec.describe 'Integration with AWS Athena' do
Egis.configure do |config|
config.work_group = 'aegis-integration-testing'
config.work_group = 'egis-integration-testing'
end

client = Egis::Client.new
test_id = "#{Time.now.to_i}_#{Random.rand(100)}"
database = client.database("egis_integration_test_#{test_id}")
testing_bucket = 'aegis-integration-testing'
testing_bucket = 'egis-integration-testing'

schema = Egis::TableSchema.define do
column :id, :int
Expand Down

0 comments on commit 78a14dc

Please sign in to comment.