Skip to content

Commit

Permalink
CircleCI Migration
Browse files Browse the repository at this point in the history
This is the first of several pull requests to bring VertexClient in line with good Rubygems standards.
To reduce the size of the original pull-request, we will first perform the migration to CircleCI under the same configuration and settings currently in the source code.
  • Loading branch information
Arne De Herdt committed Mar 13, 2020
1 parent b05a7b7 commit b3e8851
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 28 deletions.
78 changes: 78 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
# ---------------------------------------------------------------------------------------------------------------------
# CircleCI Snippets
#
# Reusable snippets are defined below this section. These are yaml fragments that can injected into the standard
# CircleCI configuration, reducing the complexity of the entire block.
# ---------------------------------------------------------------------------------------------------------------------
docker_image: &docker_image
image: 322902370520.dkr.ecr.us-east-1.amazonaws.com/customink/base-ruby-ci:2.1-v2.1
aws_auth:
aws_access_key_id: ${STAGING_AWS_ACCESS_KEY_ID}
aws_secret_access_key: ${STAGING_AWS_SECRET_ACCESS_KEY}

# ---------------------------------------------------------------------------------------------------------------------
# CircleCI Commands Configuration
#
# Commands are re-usable steps that can be shared across jobs. For example the installation of gems using bundler or
# waiting on a database connection. By defining them inside the commands section, they can be invoked as any standard
# command on the system, but will already be preconfigured. This allows us to keep the jobs definition small and clean
# ---------------------------------------------------------------------------------------------------------------------
version: 2.1
commands:
bundle_install:
description: "Performs the bundler installation, relying on the CircleCI cache for performance"
steps:
- restore_cache:
keys:
- bundler-cache-{{ checksum "vertex_client.gemspec" }}
- run:
name: "Bundle Install"
command: bundle install --path=.bundle
- save_cache:
key: bundler-cache-{{ checksum "vertex_client.gemspec" }}
paths:
- .bundle
rubocop:
description: "Runs RuboCop with the correct configuration so the results can be parsed by CircleCI"
steps:
- run:
name: "RuboCop"
command: |
bundle exec rubocop --format junit --out tmp/test-results/rubocop/results.xml
minitest:
description: "Runs Minitest with the correct configuration so it runs in parallel and is configured for CircleCI"
steps:
- run:
name: "Minitest Test Suite"
command: |
cc-test-reporter before-build
bin/test
cc-test-reporter after-build
# ---------------------------------------------------------------------------------------------------------------------
# CircleCI Job Configuration
#
# This section defines all the available jobs that can be executed inside a Workflow.
# Think of a Job as a batch of tasks that need to be performed to setup the environment and perform a specific task
# such as running RSpec, uploading the test results to CodeClimate etc.
# ---------------------------------------------------------------------------------------------------------------------
jobs:
tests:
working_directory: ~/vertex_client
docker:
- <<: *docker_image
environment:
RAILS_ENV: test
CC_TEST_REPORTER_ID: 88a7fd75659a6698f28c8c4c6b60c20f902e26733691b2fe449a65474f22b618
steps:
- checkout
- bundle_install
- minitest
- store_test_results:
path: test/reports/
workflows:
version: 2.1
vertex_client:
jobs:
- tests:
context: customink
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/coverage/
/doc/
/pkg/
/spec/reports/
/test/reports/
/tmp/
Gemfile.lock
.env.*
Expand Down
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# VertexClient Changelog

This file tracks all the changes made to the client.
This allows parsers such as Dependabot to provide a clean overview in pull requests.

## v0.7.0

- Introduced CHANGELOG.md
- Migrated to CircleCI for testing
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

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

group :test do
gem 'minitest-ci', require: false
gem 'simplecov', '< 0.18', require: false
end
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# VertexClient

[![Build Status](https://travis-ci.org/customink/vertex_client.svg?branch=master)](https://travis-ci.org/customink/vertex_client) [![Maintainability](https://api.codeclimate.com/v1/badges/5f18a48fa18ddfb942f4/maintainability)](https://codeclimate.com/github/customink/vertex_client/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/5f18a48fa18ddfb942f4/test_coverage)](https://codeclimate.com/github/customink/vertex_client/test_coverage)
[![CircleCI](https://circleci.com/gh/customink/vertex_client.svg?style=svg&circle-token=ccfd7815662866d32b9173a55820d897b162220f)](https://circleci.com/gh/customink/vertex_client)
[![Maintainability](https://api.codeclimate.com/v1/badges/5f18a48fa18ddfb942f4/maintainability)](https://codeclimate.com/github/customink/vertex_client/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/5f18a48fa18ddfb942f4/test_coverage)](https://codeclimate.com/github/customink/vertex_client/test_coverage)
[![Issue Count](https://codeclimate.com/repos/5c33a0c73c23337184000c98/badges/5f18a48fa18ddfb942f4/issue_count.svg)](https://codeclimate.com/repos/5c33a0c73c23337184000c98/feed)

The Vertex Client Ruby Gem provides an interface to integrate with _Vertex SMB_ which is also known as [Vertex Cloud Indirect Tax](https://www.vertexinc.com/solutions/products/vertex-cloud-indirect-tax).

Expand Down
29 changes: 29 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rake' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

bundle_binstub = File.expand_path("../bundle", __FILE__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rake", "rake")
2 changes: 1 addition & 1 deletion lib/vertex_client/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module VertexClient
VERSION = '0.6.8'
VERSION = '0.7.0'
end
11 changes: 11 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# frozen_string_literal: true

# SimpleCov configuration always goes first to ensure that we are generating correct code-coverage reports.
# But we only use SimpleCov on the CI System
if ENV.fetch('CI') { false }
require 'simplecov'
SimpleCov.start
end

$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require 'circuitbox'
require "simplecov"
Expand All @@ -7,6 +16,8 @@
require "vcr"
require 'byebug'
require "mocha/minitest"
require 'minitest-ci' if ENV.fetch('CI') { false }

SimpleCov.start

VertexClient.configuration # make sure the client is configured
Expand Down

0 comments on commit b3e8851

Please sign in to comment.