-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ross Kaffenberger
committed
Jul 22, 2024
1 parent
ca4ddc8
commit 701af47
Showing
2 changed files
with
64 additions
and
73 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,64 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
push: | ||
branches: | ||
- main | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
ruby: ['3.0', '3.1', '3.2', '3.3'] | ||
gemfile: | ||
- rails_6.0 | ||
- rails_6.1 | ||
- rails_7.0 | ||
- rails_7.1 | ||
# Example for excluding a specific Ruby version with a specific Gemfile | ||
# exclude: | ||
# - ruby: '3.0' | ||
# gemfile: 'rails_7.1' | ||
|
||
env: | ||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile | ||
BUNDLE_PATH_RELATIVE_TO_CWD: true | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler: default | ||
bundler-cache: true | ||
rubygems: latest | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .node-version | ||
cache: yarn | ||
cache-dependency-path: './test/sample/yarn.lock' | ||
|
||
- name: Node version | ||
run: | | ||
node --version | ||
- name: Install NPM packages for sample app | ||
run: | | ||
bundle exec rake app:yarn_install_frozen | ||
- name: StandardRb check | ||
run: bundle exec standardrb | ||
|
||
- name: Run tests | ||
run: | | ||
bundle exec rails db:test:prepare | ||
bundle exec rails test |