Skip to content

Commit 57ea7d1

Browse files
author
Arne De Herdt
authored
Merge pull request #53 from customink/coding-bunny/circleci
CircleCI Migration
2 parents b05a7b7 + b3e8851 commit 57ea7d1

9 files changed

Lines changed: 138 additions & 28 deletions

File tree

.circleci/config.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
# ---------------------------------------------------------------------------------------------------------------------
3+
# CircleCI Snippets
4+
#
5+
# Reusable snippets are defined below this section. These are yaml fragments that can injected into the standard
6+
# CircleCI configuration, reducing the complexity of the entire block.
7+
# ---------------------------------------------------------------------------------------------------------------------
8+
docker_image: &docker_image
9+
image: 322902370520.dkr.ecr.us-east-1.amazonaws.com/customink/base-ruby-ci:2.1-v2.1
10+
aws_auth:
11+
aws_access_key_id: ${STAGING_AWS_ACCESS_KEY_ID}
12+
aws_secret_access_key: ${STAGING_AWS_SECRET_ACCESS_KEY}
13+
14+
# ---------------------------------------------------------------------------------------------------------------------
15+
# CircleCI Commands Configuration
16+
#
17+
# Commands are re-usable steps that can be shared across jobs. For example the installation of gems using bundler or
18+
# waiting on a database connection. By defining them inside the commands section, they can be invoked as any standard
19+
# command on the system, but will already be preconfigured. This allows us to keep the jobs definition small and clean
20+
# ---------------------------------------------------------------------------------------------------------------------
21+
version: 2.1
22+
commands:
23+
bundle_install:
24+
description: "Performs the bundler installation, relying on the CircleCI cache for performance"
25+
steps:
26+
- restore_cache:
27+
keys:
28+
- bundler-cache-{{ checksum "vertex_client.gemspec" }}
29+
- run:
30+
name: "Bundle Install"
31+
command: bundle install --path=.bundle
32+
- save_cache:
33+
key: bundler-cache-{{ checksum "vertex_client.gemspec" }}
34+
paths:
35+
- .bundle
36+
rubocop:
37+
description: "Runs RuboCop with the correct configuration so the results can be parsed by CircleCI"
38+
steps:
39+
- run:
40+
name: "RuboCop"
41+
command: |
42+
bundle exec rubocop --format junit --out tmp/test-results/rubocop/results.xml
43+
minitest:
44+
description: "Runs Minitest with the correct configuration so it runs in parallel and is configured for CircleCI"
45+
steps:
46+
- run:
47+
name: "Minitest Test Suite"
48+
command: |
49+
cc-test-reporter before-build
50+
bin/test
51+
cc-test-reporter after-build
52+
# ---------------------------------------------------------------------------------------------------------------------
53+
# CircleCI Job Configuration
54+
#
55+
# This section defines all the available jobs that can be executed inside a Workflow.
56+
# Think of a Job as a batch of tasks that need to be performed to setup the environment and perform a specific task
57+
# such as running RSpec, uploading the test results to CodeClimate etc.
58+
# ---------------------------------------------------------------------------------------------------------------------
59+
jobs:
60+
tests:
61+
working_directory: ~/vertex_client
62+
docker:
63+
- <<: *docker_image
64+
environment:
65+
RAILS_ENV: test
66+
CC_TEST_REPORTER_ID: 88a7fd75659a6698f28c8c4c6b60c20f902e26733691b2fe449a65474f22b618
67+
steps:
68+
- checkout
69+
- bundle_install
70+
- minitest
71+
- store_test_results:
72+
path: test/reports/
73+
workflows:
74+
version: 2.1
75+
vertex_client:
76+
jobs:
77+
- tests:
78+
context: customink

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/coverage/
55
/doc/
66
/pkg/
7-
/spec/reports/
7+
/test/reports/
88
/tmp/
99
Gemfile.lock
1010
.env.*

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# VertexClient Changelog
2+
3+
This file tracks all the changes made to the client.
4+
This allows parsers such as Dependabot to provide a clean overview in pull requests.
5+
6+
## v0.7.0
7+
8+
- Introduced CHANGELOG.md
9+
- Migrated to CircleCI for testing

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
44

55
# Specify your gem's dependencies in vertex_client.gemspec
66
gemspec
7+
8+
group :test do
9+
gem 'minitest-ci', require: false
10+
gem 'simplecov', '< 0.18', require: false
11+
end

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# VertexClient
22

3-
[![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)
3+
[![CircleCI](https://circleci.com/gh/customink/vertex_client.svg?style=svg&circle-token=ccfd7815662866d32b9173a55820d897b162220f)](https://circleci.com/gh/customink/vertex_client)
4+
[![Maintainability](https://api.codeclimate.com/v1/badges/5f18a48fa18ddfb942f4/maintainability)](https://codeclimate.com/github/customink/vertex_client/maintainability)
5+
[![Test Coverage](https://api.codeclimate.com/v1/badges/5f18a48fa18ddfb942f4/test_coverage)](https://codeclimate.com/github/customink/vertex_client/test_coverage)
6+
[![Issue Count](https://codeclimate.com/repos/5c33a0c73c23337184000c98/badges/5f18a48fa18ddfb942f4/issue_count.svg)](https://codeclimate.com/repos/5c33a0c73c23337184000c98/feed)
47

58
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).
69

bin/rake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rake' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("rake", "rake")

lib/vertex_client/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module VertexClient
2-
VERSION = '0.6.8'
2+
VERSION = '0.7.0'
33
end

test/test_helper.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
# SimpleCov configuration always goes first to ensure that we are generating correct code-coverage reports.
4+
# But we only use SimpleCov on the CI System
5+
if ENV.fetch('CI') { false }
6+
require 'simplecov'
7+
SimpleCov.start
8+
end
9+
110
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
211
require 'circuitbox'
312
require "simplecov"
@@ -7,6 +16,8 @@
716
require "vcr"
817
require 'byebug'
918
require "mocha/minitest"
19+
require 'minitest-ci' if ENV.fetch('CI') { false }
20+
1021
SimpleCov.start
1122

1223
VertexClient.configuration # make sure the client is configured

0 commit comments

Comments
 (0)