-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up the main workflow file and add standardrb
- Loading branch information
1 parent
f728c53
commit 6e544b7
Showing
3 changed files
with
131 additions
and
80 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# This workflow runs the main test suite. | ||
# | ||
# This workflow is pimarily meant to be called by other workflows, but it can be run manually. | ||
name: "🧪 ~ Run gem tests" | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: "🧪" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby-version: | ||
- "3.2" | ||
gem: | ||
- "bullet_train" | ||
- "bullet_train-api" | ||
- "bullet_train-fields" | ||
- "bullet_train-has_uuid" | ||
- "bullet_train-incoming_webhooks" | ||
- "bullet_train-integrations" | ||
- "bullet_train-integrations-stripe" | ||
- "bullet_train-obfuscates_id" | ||
- "bullet_train-outgoing_webhooks" | ||
- "bullet_train-roles" | ||
- "bullet_train-scope_questions" | ||
- "bullet_train-scope_validator" | ||
- "bullet_train-sortable" | ||
- "bullet_train-super_load_and_authorize_resource" | ||
- "bullet_train-super_scaffolding" | ||
- "bullet_train-themes" | ||
- "bullet_train-themes-light" | ||
- "bullet_train-themes-tailwind_css" | ||
|
||
name: ${{ format('{0} / {1}', matrix.gem, matrix.ruby-version) }} #' | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 2s | ||
--health-timeout 2s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
env: | ||
PGHOST: localhost | ||
PGUSER: postgres | ||
PGPASSWORD: postgres | ||
RAILS_ENV: test | ||
|
||
defaults: | ||
run: | ||
working-directory: ${{ matrix.gem }} | ||
|
||
steps: | ||
- uses: "actions/checkout@v4" | ||
|
||
- uses: "ruby/setup-ruby@v1" | ||
with: | ||
rubygems: latest | ||
bundler: latest | ||
bundler-cache: true | ||
ruby-version: ${{ matrix.ruby-version }} | ||
working-directory: ${{ matrix.gem }} # setup-ruby does't pick up the job default. | ||
|
||
# TODO: Sometimes the step above complains about the lockfile being fronzen. | ||
# When that happens you can get things moving again by chaning the bundler-cache | ||
# option above to false. Then _must_ uncomment the line for `bundle install` and | ||
# you can also uncomment the following lines to find out what changed unexpectedly. | ||
# I _think_ I've got things set up so that this shouldn't be an issue any more, but | ||
# I'm leaving this stuff here in case it comes in handy in the near future. | ||
# | ||
#- run: bundle install | ||
#- run: cat Gemfile.lock | ||
#- run: git diff Gemfile.lock | ||
|
||
- run: bin/rails db:setup | ||
if: ${{ hashFiles(format('{0}/test/dummy/db/schema.rb', matrix.gem)) != '' }} | ||
|
||
- name: Run Tests | ||
run: bin/rails test | ||
|
||
- name: Test Summary | ||
uses: test-summary/action@v2 | ||
with: | ||
paths: "test/reports/**/TEST-*.xml" | ||
if: always() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This workflow will run standardrb. | ||
# | ||
# This workflow is pimarily meant to be called by other workflows, but it can be run manually. | ||
name: "🔬 ~ Standardrb" | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
env: | ||
RAILS_ENV: test | ||
BUNDLE_JOBS: 2 | ||
BUNDLE_RETRY: 3 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Ruby and gems | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: Run Standardrb | ||
id: run-standardrb | ||
run : bundle exec standardrb |
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