fix test #30
This file contains hidden or 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: Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
BUNDLE_FROZEN: 'false' | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby-version: ['3.2', '3.3', '3.4'] | |
rails-version: ['7.2', '8.0'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler-cache: true # Enable bundler caching | |
cache-version: ${{ matrix.ruby-version }}-${{ matrix.rails-version }} # Custom cache key | |
- name: Get Node version | |
id: node-version | |
run: echo "NODE_VERSION=$(cat .node-version | tr -d '\n')" >> $GITHUB_OUTPUT | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ steps.node-version.outputs.NODE_VERSION }} | |
cache: 'npm' | |
- name: Install npm dependencies | |
run: npm install | |
- name: Set Rails version | |
run: bundle add railties --version "~> ${{ matrix.rails-version }}" | |
- name: Run tests | |
run: bin/test |