-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from FundingCircle/migrate-to-gh-actions
Fix rails 7.1 support and migrate to github actions
- Loading branch information
Showing
63 changed files
with
1,123 additions
and
452 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Build & Test | ||
run-name: Build & Test - ${{ github.ref_name }} | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
version-check: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.ref, 'master')" | ||
steps: | ||
- name: Checkout commit | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Gem versioned correctly | ||
shell: sh | ||
run: | | ||
CHANGED=$(git diff origin/master HEAD --name-only | grep 'lib/loga') || exit 0 | ||
[[ -z "$CHANGED" ]] || (echo "$CHANGED" | grep 'version.rb') || exit 1 | ||
rubocop: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.3' | ||
bundler-cache: true | ||
|
||
- name: Run RuboCop | ||
run: bundle exec rubocop | ||
|
||
build-and-test: | ||
runs-on: ubuntu-latest | ||
services: | ||
redis: | ||
image: redis:7 | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 6379:6379 | ||
strategy: | ||
matrix: | ||
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', 'head'] | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby ${{ matrix.ruby-version }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true | ||
|
||
- name: Install appraisal gems | ||
run: bundle exec appraisal install | ||
|
||
- name: Test with RACK_ENV=development | ||
run: RACK_ENV=development bundle exec appraisal rspec | ||
|
||
- name: Test with RACK_ENV=production | ||
run: RACK_ENV=production bundle exec appraisal rspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Deploy to RubyGems | ||
run-name: ${{ github.actor }} is publishing a new version | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish-gem: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.3' | ||
bundler-cache: true | ||
|
||
- name: Build gem | ||
run: gem build loga.gemspec | ||
|
||
- name: Publish gem | ||
env: | ||
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | ||
run: | | ||
gem push loga-*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.