DEV: Move dev dependencies to gemspec (#57) #176
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
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: ['2.6', '2.7', '3.0', '3.1'] | |
build_type: ['redis', 'active_record'] | |
include: | |
- ruby: '3.1' | |
build_type: 'lint' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
- name: Setup gems | |
run: bundle install | |
- name: Rubocop | |
if: matrix.build_type == 'lint' | |
run: bundle exec rubocop | |
- name: Setup redis | |
if: matrix.build_type == 'redis' | |
run: sudo apt-get install redis-server | |
- name: Redis specs | |
if: matrix.build_type == 'redis' | |
run: bin/rspec redis | |
- name: Setup test app gems | |
if: matrix.build_type == 'active_record' | |
run: cd spec/support/dummy_app && bundle install | |
- name: Setup postgres | |
if: matrix.build_type == 'active_record' | |
run: | | |
make setup_pg | |
make start_pg | |
- name: ActiveRecord specs | |
if: matrix.build_type == 'active_record' | |
run: bin/rspec active_record | |
publish: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Release Gem | |
uses: discourse/publish-rubygems-action@v2 | |
env: | |
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
GIT_EMAIL: team@discourse.org | |
GIT_NAME: discoursebot |