Skip to content

Commit 0a39c78

Browse files
authored
Merge pull request #131 from FundingCircle/migrate-to-gh-actions
Fix rails 7.1 support and migrate to github actions
2 parents 0c3bbdd + a3b204f commit 0a39c78

63 files changed

Lines changed: 1123 additions & 452 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 0 additions & 112 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build & Test
2+
run-name: Build & Test - ${{ github.ref_name }}
3+
4+
on:
5+
push:
6+
branches:
7+
- '**'
8+
9+
jobs:
10+
version-check:
11+
runs-on: ubuntu-latest
12+
if: "!contains(github.ref, 'master')"
13+
steps:
14+
- name: Checkout commit
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Gem versioned correctly
20+
shell: sh
21+
run: |
22+
CHANGED=$(git diff origin/master HEAD --name-only | grep 'lib/loga') || exit 0
23+
[[ -z "$CHANGED" ]] || (echo "$CHANGED" | grep 'version.rb') || exit 1
24+
25+
rubocop:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Check out repository code
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Ruby
32+
uses: ruby/setup-ruby@v1
33+
with:
34+
ruby-version: '3.3'
35+
bundler-cache: true
36+
37+
- name: Run RuboCop
38+
run: bundle exec rubocop
39+
40+
build-and-test:
41+
runs-on: ubuntu-latest
42+
services:
43+
redis:
44+
image: redis:7
45+
options: >-
46+
--health-cmd "redis-cli ping"
47+
--health-interval 10s
48+
--health-timeout 5s
49+
--health-retries 5
50+
ports:
51+
- 6379:6379
52+
strategy:
53+
matrix:
54+
ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', 'head']
55+
steps:
56+
- name: Check out repository code
57+
uses: actions/checkout@v4
58+
59+
- name: Set up Ruby ${{ matrix.ruby-version }}
60+
uses: ruby/setup-ruby@v1
61+
with:
62+
ruby-version: ${{ matrix.ruby-version }}
63+
bundler-cache: true
64+
65+
- name: Install appraisal gems
66+
run: bundle exec appraisal install
67+
68+
- name: Test with RACK_ENV=development
69+
run: RACK_ENV=development bundle exec appraisal rspec
70+
71+
- name: Test with RACK_ENV=production
72+
run: RACK_ENV=production bundle exec appraisal rspec

.github/workflows/publish-gem.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy to RubyGems
2+
run-name: ${{ github.actor }} is publishing a new version
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
publish-gem:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out repository code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Ruby
16+
uses: ruby/setup-ruby@v1
17+
with:
18+
ruby-version: '3.3'
19+
bundler-cache: true
20+
21+
- name: Build gem
22+
run: gem build loga.gemspec
23+
24+
- name: Publish gem
25+
env:
26+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
27+
run: |
28+
gem push loga-*.gem

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
inherit_from: .rubocop_todo.yml
2+
13
AllCops:
4+
TargetRubyVersion: 2.7
5+
NewCops: enable
26
Exclude:
37
- '*.gemspec'
48
- 'gemfiles/*'

0 commit comments

Comments
 (0)