support multiple heroku tokens for the same highlight project (#9601) #5
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: Ruby SDK | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- 'sdk/highlight-ruby/**' | |
- '.github/workflows/ruby.yml' | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
build: | |
name: Ruby SDK | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ruby: ['3.0', '3.3'] | |
defaults: | |
run: | |
working-directory: ./sdk/highlight-ruby/highlight | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
ruby-changed: | |
- 'sdk/highlight-ruby/**' | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Install dependencies | |
run: bundle install | |
- name: Test | |
run: bundle exec rake | |
- name: Rubocop | |
run: bundle exec rubocop | |
- name: Publish to RubyGems | |
if: github.ref == 'refs/heads/main' && matrix.ruby == '3.3' && steps.filter.outputs.ruby-changed == 'true' | |
run: | | |
mkdir -p $HOME/.gem | |
touch $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials | |
gem build *.gemspec | |
gem push *.gem | |
env: | |
RUBYGEMS_API_KEY: '${{secrets.RUBYGEMS_API_KEY}}' | |
e2e: | |
name: Rails Example App Tests | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./e2e/ruby/rails/demo | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3.4' | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Install dependencies | |
run: bundle install | |
- name: Test | |
run: bundle exec rake | |
- name: Rubocop | |
run: bundle exec rubocop | |
e2e-api-only: | |
name: Rails API-Only Example App Tests | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./e2e/ruby/rails/api-only | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3.4' | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Install dependencies | |
run: bundle install | |
- name: Test | |
run: bundle exec rake |