Skip to content

Commit

Permalink
Rollback old workflow and use composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior committed May 9, 2024
1 parent d891a78 commit 8d1f268
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 59 deletions.
69 changes: 14 additions & 55 deletions .github/workflows/audiences.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,19 @@ name: audiences

on:
push:

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }} / ${{ matrix.gemfile }}
strategy:
fail-fast: false
matrix:
ruby:
- 3.0
- 3.1
- 3.2
- 3.3
gemfile:
- gemfiles/rails_6_1.gemfile
- gemfiles/rails_7_0.gemfile
- gemfiles/rails_7_1.gemfile
exclude:
- ruby: 3.2
gemfile: gemfiles/rails_6_1.gemfile
- ruby: 3.3
gemfile: gemfiles/rails_6_1.gemfile
env:
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
BUNDLER_VERSION: 2
RAILS_ENV: test
steps:
- uses: actions/checkout@v3
- name: Install non-ruby dependencies
run: sudo apt-get install libpq-dev
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
bundler: 2
ruby-version: ${{ matrix.ruby }}
working-directory: audiences
- name: Run the build script
working-directory: audiences
run: bundle exec rake

license-compliance:
uses: powerhome/github-actions-workflows/.github/workflows/license-compliance.yml@main
jobs:
ruby:
uses: powerhome/github-actions-workflows/.github/workflows/ruby-gem.yml@rubygem-action
with:
workdir: "audiences"

release:
needs: [build, license-compliance]
runs-on: ubuntu-latest
if: ${{ contains(github.ref, 'refs/tags/v') && contains(github.ref, 'audiences') }}
steps:
- uses: actions/checkout@v3
- uses: cadwallion/publish-rubygems-action@master
env:
RELEASE_COMMAND: rake build release:guard_clean release:rubygem_push
RUBYGEMS_API_KEY: ${{ secrets.rubygems_api_key }}
WORKDIR: "audiences"
package: ${{ github.workflow }}
workdir: ${{ github.workflow }}
before_build: sudo /etc/init.d/mysql start
gemfiles: "['gemfiles/rails_6_1.gemfile','gemfiles/rails_7_0.gemfile','gemfiles/rails_7_1.gemfile']"
ruby: '["3.0","3.1","3.2","3.3"]'
exclude: |-
[
{ 'ruby': '3.2', 'gemfile': 'gemfiles/rails_6_1.gemfile'},
{ 'ruby': '3.3', 'gemfile': 'gemfiles/rails_6_1.gemfile'},
]
secrets: inherit
2 changes: 1 addition & 1 deletion audiences/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ gem "vite_rails", "~> 3.0"
gem "webmock", "~> 3.18"

# Development environment dependencies
gem "pg", "~> 1.0"
gem "mysql2", "~> 0.5.6"
gem "pg", "~> 1.0"
gem "puma", "~> 6.3"
2 changes: 1 addition & 1 deletion audiences/gemfiles/rails_6_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ gem "rubocop-powerhome"
gem "shoulda-matchers", "~> 5.0"
gem "vite_rails", "~> 3.0"
gem "webmock", "~> 3.18"
gem "pg", "~> 1.0"
gem "mysql2", "~> 0.5.6"
gem "pg", "~> 1.0"
gem "puma", "~> 6.3"

gemspec path: "../"
2 changes: 1 addition & 1 deletion audiences/gemfiles/rails_7_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ gem "rubocop-powerhome"
gem "shoulda-matchers", "~> 5.0"
gem "vite_rails", "~> 3.0"
gem "webmock", "~> 3.18"
gem "pg", "~> 1.0"
gem "mysql2", "~> 0.5.6"
gem "pg", "~> 1.0"
gem "puma", "~> 6.3"

gemspec path: "../"
2 changes: 1 addition & 1 deletion audiences/gemfiles/rails_7_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ gem "rubocop-powerhome"
gem "shoulda-matchers", "~> 5.0"
gem "vite_rails", "~> 3.0"
gem "webmock", "~> 3.18"
gem "pg", "~> 1.0"
gem "mysql2", "~> 0.5.6"
gem "pg", "~> 1.0"
gem "puma", "~> 6.3"

gemspec path: "../"

0 comments on commit 8d1f268

Please sign in to comment.