Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Custom CodeQL"
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: Ubuntu-latest
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['ruby']
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Initialize CodeQL
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3
with:
category: "/language:${{matrix.language}}"
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release
on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [main]
workflow_dispatch: # allow manual deployment through GitHub Action UI
jobs:
version-check:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
outputs:
changed: ${{ steps.check.outputs.any_changed }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Check if version has been updated
id: check
uses: tj-actions/changed-files@3c4bc6fa0ca4718d438e0a4bd3ea81fbb0e6e2be # v44
with:
files: lib/migration_lock_timeout/version.rb
release:
runs-on: ubuntu-latest
needs: version-check
if: ${{ github.event_name == 'workflow_dispatch' || needs.version-check.outputs.changed == 'true' }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Set up Ruby
uses: ruby/setup-ruby@675dd7ba1b06c8786a1480d89c384f5620a42647 # v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Installing dependencies
run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
- name: Build gem file
run: bundle exec rake build
- uses: fac/ruby-gem-setup-credentials-action@5f62d5f2f56a11c7422a92f81fbb29af01e1c00f # v2
with:
user: ""
key: rubygems
token: ${{secrets.RUBY_GEMS_API_KEY}}
- uses: fac/ruby-gem-push-action@81d77bf568ff6659d7fae0f0c5a036bb0aeacb1a # v2
with:
key: rubygems
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
ruby: ['3.1']
postgres: ['15.1']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have plans to bump this up? Or provide a matrix of versions to test against?

Copy link
Contributor Author

@joe-sharp joe-sharp Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it easy to do so, but for this PR I am keeping the versions the same as before.

runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_DB_HOST: postgres
POSTGRES_DB_USERNAME: postgres
POSTGRES_DB_DATABASE: postgres
POSTGRES_DB_PASSWORD: postgres
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@675dd7ba1b06c8786a1480d89c384f5620a42647 # v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install Ruby Dependencies
run: bundle check || bundle install
- name: Install Appraisals Dependencies
run: bundle exec appraisal install
- name: Run Appraisals Tests
run: bundle exec appraisal rspec
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ environment variables `POSTGRES_DB_USERNAME` and `POSTGRES_DB_PASSWORD` then run

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/procore/migration-lock-timeout. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
Bug reports and pull requests are welcome on GitHub at https://github.com/procore-oss/migration-lock-timeout. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.


## License
Expand Down
2 changes: 1 addition & 1 deletion migration-lock-timeout.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|

spec.summary = "Ruby gem that adds a lock timeout to Active Record migrations"
spec.description = "Ruby gem that automatically adds a lock timeout to all Active Record migrations"
spec.homepage = "http://github.com/procore/migration-lock-timeout"
spec.homepage = "http://github.com/procore-oss/migration-lock-timeout"
spec.license = "MIT"

# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
Expand Down