46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: Ruby on Rails Test
|
|
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }} 🚀
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- develop
|
|
|
|
jobs:
|
|
rails-test:
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
RAILS_ENV: test
|
|
# SQLite does not require these variables, but you can keep them for consistency
|
|
DB_TEST_ADAPTER: "sqlite3"
|
|
DB_TEST_DATABASE: "data/test.sqlite" # Default SQLite database file path
|
|
DB_TEST_USERNAME: "root"
|
|
DB_TEST_PASSWORD: "root"
|
|
RUNNER_TOOL_CACHE: /toolcache # Optional, for caching
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: .ruby-version # Not needed with a .ruby-version, .tool-versions or mise.toml
|
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
echo "📦 Installing dependencies..."
|
|
gem install bundler
|
|
bundle install --jobs 4 --retry 3
|
|
npm install -g yarn
|
|
yarn install
|
|
echo "📦 Dependencies installed!"
|
|
|
|
- name: Run linter
|
|
run: |
|
|
echo "🚫 Running linter..."
|
|
bundle exec rubocop
|
|
echo "🚫 Linter complete!"
|