Skip to content

Commit

Permalink
Set up CI and CD, using packs-rails as a model (#3)
Browse files Browse the repository at this point in the history
* set up CI and CD

* bump version

* do not test against ruby head for now... issues with nokogiri
  • Loading branch information
Alex Evanczuk authored May 18, 2023
1 parent d845508 commit ab13a92
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CD

on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@8230315d06ad95c617244d2f265d237a1682d445
- name: Tag and Push Gem
id: tag-and-push-gem
uses: discourse/publish-rubygems-action@04549cca4eecd343acd215114ebbbdb99630af90
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GIT_EMAIL: ${{secrets.ALEX_GIT_EMAIL}}
GIT_NAME: ${{secrets.ALEX_GIT_NAME}}
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
- name: Create GitHub Release
run: gh release create v${{steps.tag-and-push-gem.outputs.gem_version}} --generate-notes
if: ${{ steps.tag-and-push-gem.outputs.new_version == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on: [push, pull_request]

jobs:
rspec:
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- 2.7
# See comment comes from https://github.com/ruby/setup-ruby#matrix-of-ruby-versions
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
- '3.0'
- 3.1
env:
BUNDLE_GEMFILE: Gemfile
name: "RSpec tests: Ruby ${{ matrix.ruby }}"
steps:
- uses: actions/checkout@8230315d06ad95c617244d2f265d237a1682d445
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}
- name: Run tests
run: bundle exec rspec
5 changes: 3 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
bigrails-redis (0.7.0)
bigrails-redis (0.7.1)
activesupport (>= 6)
railties (>= 6)
redis (>= 4)
Expand Down Expand Up @@ -111,6 +111,7 @@ GEM
zeitwerk (2.5.4)

PLATFORMS
arm64-darwin-20
arm64-darwin-21
x86_64-darwin-21
x86_64-linux
Expand All @@ -125,4 +126,4 @@ DEPENDENCIES
standard

BUNDLED WITH
2.2.32
2.4.12
2 changes: 1 addition & 1 deletion lib/big_rails/redis/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module BigRails
module Redis
VERSION = "0.7.0"
VERSION = "0.7.1"
end
end

0 comments on commit ab13a92

Please sign in to comment.