Skip to content

Commit

Permalink
openapi (#114)
Browse files Browse the repository at this point in the history
* openapi

* fix build command

* mockon using github actions

* install dependencies

* unit test

* test webhook keys

* versioning mock service and delete travis file

* new release version mock server
  • Loading branch information
fcarrero authored Aug 1, 2023
1 parent cab1822 commit 9a19f20
Show file tree
Hide file tree
Showing 584 changed files with 82,271 additions and 4,661 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# see http://editorconfig.org/

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# may be useful in hiding large schema changes in pull request diffs (but not
# using it for now)
spec/*.json binary
spec/*.yaml binary
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @fcarrero @macuartin @agatto-conekta @fernandosaenzconekta @ezerozen
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
workflow_dispatch: {}
push:
branches:
- master
pull_request:
branches:
- master

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

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- name: Lint
run: bundle install
- name: Build
run: gem build conekta.gemspec

test:
name: Test (${{ matrix.ruby-version }})
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [2.6, 2.7, '3.0', 3.1, 3.2]
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: install
run: bundle install
- name: Run Mockoon CLI
uses: mockoon/cli-action@v1
with:
version: 'latest'
data-file: 'https://raw.githubusercontent.com/conekta/openapi/20230801/mocks/conekta_api.json'
port: 3000
- name: test
run: make ci-test
env:
BASE_PATH: http://localhost:3000

40 changes: 40 additions & 0 deletions .github/workflows/PUBLISH.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PUBLISH
on:
release:
types: [created]

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Check if release creator is a code owner
run: |
if [[ $(jq '.sender.type' $GITHUB_EVENT_PATH) == '"User"' ]]; then
creator_login=${{ github.event.release.author.login }}
if ! grep -q $creator_login .github/CODEOWNERS; then
echo "Release creator is not a code owner, skipping the rest of the workflow."
exit 1
fi
fi
- name: Validate release version
run: |
tag_name=${{ github.event.release.tag_name }}
version=$(cat VERSION)
if [ $tag_name != $version ]; then
echo "Release tag_name is not the same that in file VERSION"
exit 1
fi
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
with:
name: gems
path: gems
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- name: Publish gems to Rubygems
run: gem push gems/*.gem
env:
GEM_HOST_API_KEY: ${{secrets.GEM_HOST_API_KEY}}
60 changes: 41 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
# Generated by: https://openapi-generator.tech
#

*.gem
*.rbc
.bundle
.config
.yardoc
.byebug_history
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

## Specific to RubyMotion:
.dat*
.repl_history
build/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
bin/
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

/conekta-*.gem
/Gemfile.lock
tags
*.swp
*.un~
.byebug_history
coverage/
.idea/
26 changes: 26 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.ruby: &ruby
variables:
LANG: "C.UTF-8"
before_script:
- ruby -v
- bundle config set --local deployment true
- bundle install -j $(nproc)
parallel:
matrix:
- RUBY_VERSION: ['2.7', '3.0', '3.1']
image: "ruby:$RUBY_VERSION"
cache:
paths:
- vendor/ruby
key: 'ruby-$RUBY_VERSION'

gem:
extends: .ruby
script:
- bundle exec rspec
- bundle exec rake build
- bundle exec rake install
artifacts:
paths:
- pkg/*.gem

27 changes: 27 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

git_push.sh
.gitignore
.travis.yml
Loading

0 comments on commit 9a19f20

Please sign in to comment.