Skip to content

Commit

Permalink
Merge branch 'rares-c-stripe_unpause_fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed May 29, 2024
2 parents 0f2a840 + 21a0749 commit 855cd92
Show file tree
Hide file tree
Showing 29 changed files with 764 additions and 462 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
ARG RUBY_VERSION=3.3.1
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION
58 changes: 58 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
services:
rails-app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile

volumes:
- ../..:/workspaces:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

networks:
- default

# Uncomment the next line to use a non-root user for all processes.
# user: vscode

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
ports:
- 45678:45678
depends_on:
- selenium
- mysql
- postgres

selenium:
image: seleniarm/standalone-chromium
restart: unless-stopped
networks:
- default

mysql:
image: mysql/mysql-server:8.0
restart: unless-stopped
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'true'
MYSQL_ROOT_HOST: "%"
volumes:
- mysql-data:/var/lib/mysql
networks:
- default

postgres:
image: postgres:16.1
restart: unless-stopped
networks:
- default
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

volumes:
mysql-data:
postgres-data:
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
{
"name": "pay_gem",
"dockerComposeFile": "compose.yaml",
"service": "rails-app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/rails/devcontainer/features/activestorage": {},
"ghcr.io/rails/devcontainer/features/mysql-client": {},
"ghcr.io/rails/devcontainer/features/postgres-client": {}
},

"containerEnv": {
"CAPYBARA_SERVER_PORT": "45678",
"SELENIUM_HOST": "selenium",
"DATABASE_URL": "sqlite3:test.sqlite3"
// "DATABASE_URL": "postgresql://postgres:postgres@postgres:5432/test"
// "DATABASE_URL": "mysql2://root@mysql:3306/test"
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000, 3306, 5432, 6379],

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root",


// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bin/setup"
}
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
push:
branches:
- main
workflow_call:

jobs:
sqlite:
runs-on: ubuntu-latest
Expand Down
31 changes: 26 additions & 5 deletions .github/workflows/publish_gem.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
name: Publish gem
on: workflow_dispatch
name: Publish Gem
on:
workflow_dispatch:
inputs:
version:
description: "Version"
required: true
type: string

jobs:
test:
uses: ./.github/workflows/ci.yml

push:
name: Publish gem to RubyGems.org
needs: test
runs-on: ubuntu-latest

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
contents: write
id-token: write

steps:
# Set up
Expand All @@ -19,5 +28,17 @@ jobs:
bundler-cache: true
ruby-version: ruby

- name: Update version
run: |
sed -i 's/".*"/"${{ inputs.version }}"/' lib/pay/version.rb
bundle config set --local deployment 'false'
bundle
bundle exec appraisal
git config user.name 'GitHub Actions'
git config user.email github-actions@github.com
git add Gemfile.lock gemfiles lib
git commit -m "Version bump"
git push
# Release
- uses: rubygems/release-gem@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ test/dummy/public/packs-test/
test/dummy/node_modules/
test/dummy/config/credentials.yml.enc
test/dummy/config/master.key
test/dummy/storage
.DS_Store
.byebug_history
*.swp
Expand Down
4 changes: 4 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
appraise "rails-6-1" do
gem "rails", "~> 6.1.0"
gem "sqlite3", "~> 1.4"
end

appraise "rails-7" do
gem "rails", "~> 7.0.0"
gem "sqlite3", "~> 1.4"
end

appraise "rails-7-1" do
gem "rails", "~> 7.1.0"
gem "sqlite3", "~> 1.4"
end

appraise "rails-main" do
gem "rails", github: "rails/rails", branch: "main"
gem "sqlite3", "~> 2.0"
end
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

### Unreleased

### 7.2.0

* Add devcontainer for easier development #988
* Stripe 11.x #980
* Update Paddle billing payment method sync #946
* Improve compatibility for fake processor charge with other payment processors by ignoring any non-attribute params. #965

### 7.1.1
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ gem "vcr"
gem "webmock"

gem "braintree", ">= 2.92.0"
gem "stripe", "~> 10.11"
gem "paddle", "~> 2.1"
gem "stripe", "~> 11.0"
gem "paddle", "~> 2.2"

gem "receipts"
gem "prawn"

# Test against different databases
gem "pg"
gem "mysql2"
gem "sqlite3", "~> 1.7.2"
gem "sqlite3", "~> 1.7"

# Used for the dummy Rails app integration
gem "puma"
Expand Down
Loading

0 comments on commit 855cd92

Please sign in to comment.