Skip to content

Commit

Permalink
Merge pull request #8 from qonto/github-actions
Browse files Browse the repository at this point in the history
Switch to github actions
  • Loading branch information
MaximeD authored Jun 6, 2023
2 parents a58c34e + ebe15a2 commit 78fc19b
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 25 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/rubygems.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Ruby Gem

on:
push:
branches:
- master
paths:
- lib/version.rb

jobs:
build:
name: Build and publish
runs-on: ubuntu-latest
environment: master
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
27 changes: 27 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Tests

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['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 }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rake
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Idempotent Request [![Build Status](https://travis-ci.org/qonto/idempotent-request.svg?branch=master)](https://travis-ci.org/qonto/idempotent-request)
![Gem Version](https://badge.fury.io/rb/idempotent-request.svg) ![CI Status](https://github.com/qonto/idempotent-request/actions/workflows/tests.yml/badge.svg)

# Idempotent Requestidempotent-request

Rack middleware ensuring at most once requests for mutating endpoints.

Expand Down Expand Up @@ -140,11 +142,11 @@ Get notified when a client sends a request with the same idempotency key:
```ruby
class RailsCallback
attr_reader :request

def initialize(request)
@request = request
end

def detected(key:)
Rails.logger.warn "IdempotentRequest request detected, key: #{key}"
end
Expand All @@ -166,3 +168,8 @@ The gem is available as open source under the terms of the [MIT License](http://
## Code of Conduct

Everyone interacting in the Idempotent::Request project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/idempotent-request/blob/master/CODE_OF_CONDUCT.md).


## Releasing

To publish a new version to rubygems, update the version in `lib/version.rb`, and merge.
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module IdempotentRequest
VERSION = "0.1.7"
VERSION = "0.2.0"
end

0 comments on commit 78fc19b

Please sign in to comment.