Skip to content

Commit

Permalink
Merge pull request #241 from razorpay/github-action
Browse files Browse the repository at this point in the history
GitHub Actions
  • Loading branch information
Nemo committed Aug 12, 2021
2 parents 461672a + 9bfe10b commit 290f869
Show file tree
Hide file tree
Showing 17 changed files with 131 additions and 661 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/scraper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
push:
workflow_dispatch:
inputs:
release:
description: Version
required: false
name: Scraper
jobs:
scraper:
name: Run
runs-on: ubuntu-latest
steps:
- name: Install ssconvert
run: sudo apt-get -y --no-install-recommends install gnumeric
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true
- name: Install scraper dependencies
run: bundle install
working-directory: scraper
- name: Run scraper
run: bash bootstrap.sh
working-directory: scraper/scripts
- name: Save artifacts
uses: actions/upload-artifact@v2
with:
name: release-artifact
path: |
scraper/scripts/data/*
! scraper/scripts/data/by-bank.tar
php:
needs: scraper
name: Post-scraper tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: shivammathur/setup-php@v2
with:
php-version: 8.0
tools: phpunit, composer
- run: composer install --no-interaction
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: release-artifact
path: scraper/scripts/data
- run: phpunit -d memory_limit=-1
env:
RUN_DATASET_TESTS: true
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on: push
name: Tests
jobs:
node:
strategy:
matrix:
node: ["16", "14", "12"]
name: Node.js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v2
with:
node-version: ${{matrix.node}}
- run: npm install
- run: npm test
php:
strategy:
matrix:
# https://www.php.net/supported-versions.php
php: ["7.3", "7.4", "8.0"]
name: PHP
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: shivammathur/setup-php@v2
with:
php-version: ${{matrix.php}}
tools: phpunit, composer
- run: composer install --no-interaction
- run: phpunit -d memory_limit=-1
ruby:
strategy:
matrix:
ruby: ["3.0", "2.6", "2.7"]
name: Ruby
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle install
- run: bundle exec rake
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ src/patches/*
tests/
tmp/
*.csv
.github/*
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [UNRELEASED][unreleased]
## [2.0.0][2.0.0]
### Removed
- Removed support for Elixir package
### Changed
- Builds are now powered by GitHub Actions, instead of Wercker

## [1.6.1][1.6.1]
### Added
Expand Down Expand Up @@ -210,7 +215,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Removes some data formats (YAML/Large JSON) for cleaner code. If you were using them, please let create an issue.

[unreleased]: https://github.com/razorpay/ifsc/compare/1.6.1...HEAD
[unreleased]: https://github.com/razorpay/ifsc/compare/2.0.0...HEAD
[2.0.0]: https://github.com/razorpay/ifsc/releases/tag/2.0.0
[1.6.1]: https://github.com/razorpay/ifsc/releases/tag/1.6.1
[1.5.13]: https://github.com/razorpay/ifsc/releases/tag/1.5.13
[1.5.12]: https://github.com/razorpay/ifsc/releases/tag/1.5.12
Expand Down
65 changes: 3 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ This is part of the IFSC toolset released by Razorpay.
You can find more details about the entire release at
[ifsc.razorpay.com](https://ifsc.razorpay.com).

[![wercker status](https://app.wercker.com/status/bc9b22047e1b8eb55ce98ba451d7b504/s/master 'wercker status')](https://app.wercker.com/project/byKey/bc9b22047e1b8eb55ce98ba451d7b504) [![](https://images.microbadger.com/badges/image/razorpay/ifsc:1.6.1.svg)](https://microbadger.com/images/razorpay/ifsc:1.6.1) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![](https://images.microbadger.com/badges/image/razorpay/ifsc:1.6.1.svg)](https://microbadger.com/images/razorpay/ifsc:1.6.1) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

[![](https://images.microbadger.com/badges/version/razorpay/ifsc:1.6.1.svg)](https://microbadger.com/images/razorpay/ifsc:1.6.1) [![npm version](https://badge.fury.io/js/ifsc.svg)](https://badge.fury.io/js/ifsc) [![Gem Version](https://badge.fury.io/rb/ifsc.svg)](https://badge.fury.io/rb/ifsc) [![PHP version](https://badge.fury.io/ph/razorpay%2Fifsc.svg)](https://badge.fury.io/ph/razorpay%2Fifsc) [![Hex pm](http://img.shields.io/hexpm/v/ifsc.svg)](https://hex.pm/packages/ifsc)

## Dataset

If you are just looking for the dataset, go to
the [releases][releases] section and download
the latest release.
If you are just looking for the dataset, go to the [releases][releases] section and download the latest release.

The latest [`build` pipeline][buildlist] on Wercker should result in a container
with the complete dataset as well.
The latest `scraper` workflow on GitHub should publish a `release-artifact` as well.

### Source

Expand Down Expand Up @@ -93,7 +90,6 @@ Only the latest version of each SDK is considered.
| -------- | ---------- | ---------- | ----------------------- | -------------- |
| PHP ||| ✅ (✅) ||
| Ruby ||| ✅ (✅) ||
| Elixir ||| ✅ (❎) ||
| Node.js ||| ❎ (❎) ||

## API Documentation
Expand Down Expand Up @@ -281,60 +277,6 @@ Razorpay::IFSC::IFSC.find '...'
code = Razorpay::IFSC::IFSC.new '...'; code.get
```

### Elixir

Documentation: [https://hexdocs.pm/ifsc](https://hexdocs.pm/ifsc)

Online validation

```elixir
iex> IFSC.get("KKBK0000261")
{:ok,
%Razorpay.IFSC{
address: "JMD REGENT SQUARE,MEHRAULI GURGAON ROAD,OPPOSITE BRISTOL HOTEL,",
bank: "Kotak Mahindra Bank",
bank_code: "KKBK",
branch: "GURGAON",
city: "GURGAON",
contact: "4131000",
district: "GURGAON",
ifsc: "KKBK0000261",
rtgs: true,
state: "HARYANA"
}}

iex> IFSC.get("foobar")
{:error, :invalid_ifsc}
```

Offline validation

```elixir
iex> IFSC.validate("KKBK0000261")
{:ok,
%Razorpay.IFSC{
address: nil,
bank: "Kotak Mahindra Bank",
bank_code: "KKBK",
branch: nil,
city: nil,
contact: nil,
district: nil,
ifsc: "KKBK0000261",
rtgs: nil,
state: nil
}}

iex> IFSC.validate("foobar")
{:error, :invalid_format}

iex> IFSC.validate("AAAA0000000")
{:error, :invalid_bank_code}

iex(> IFSC.validate("HDFC0000000")
{:error, :invalid_branch_code}
```

### Code Notes

Both the packages ship with a 300kb JSON file, that
Expand All @@ -358,6 +300,5 @@ is under public domain.

[combined]: https://rbidocs.rbi.org.in/rdocs/content/docs/68774.xlsx
[releases]: https://github.com/razorpay/ifsc/releases
[buildlist]: https://app.wercker.com/razorpay/ifsc/runs?view=runs&q=pipeline%3Abuild
[rtgs]: https://rbidocs.rbi.org.in/rdocs/RTGS/DOCs/RTGEB0815.xlsx
[ach]: https://www.npci.org.in/what-we-do/nach/live-members/live-banks
14 changes: 5 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,27 @@
"/node_modules/",
"/src/node/",
"/src/ruby/",
"/src/elixir/",
"/tests/ruby/",
"/tests/node/",
"/tests/elixir/",
"/tests/fixture/exvcr/",
"/.npmignore",
"/Gemfile*",
"/package.json",
"/mix.exs",
"/mix.lock",
"/priv/ifsc-data/"
]
},
"require": {
"php": "^7.1|^8.0",
"php-http/client-implementation": "^1.0",
"php-http/discovery": "^1.6",
"php-http/discovery": "^1.14",
"php-http/message-factory": "^1.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"guzzlehttp/psr7" : "^1.3",
"php-http/message" : "^1.7",
"php-http/mock-client" : "^0.3 || ^1.0",
"phpunit/phpunit" : "^6.0 || ^8.0 || ^7.0",
"guzzlehttp/psr7" : "^2.0",
"php-http/message" : "^1.11",
"php-http/mock-client" : "^1.4",
"phpunit/phpunit" : "^9.0",
"symfony/yaml": "^5.0"
},
"scripts": {
Expand Down
77 changes: 0 additions & 77 deletions mix.exs

This file was deleted.

36 changes: 0 additions & 36 deletions src/elixir/README.md

This file was deleted.

1 change: 0 additions & 1 deletion src/elixir/config/config.exs

This file was deleted.

11 changes: 0 additions & 11 deletions src/elixir/lib/mix/tasks/copy_json.ex

This file was deleted.

Loading

0 comments on commit 290f869

Please sign in to comment.