Skip to content

chore: consolidate workflows #2

chore: consolidate workflows

chore: consolidate workflows #2

name: JS From Routes
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
rspec:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' || matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ruby: [
"3.2",
"3.3",
]
gemfile: [
"Gemfile-rails.7.2.x"
]
experimental: [false]
include:
- ruby: "3.3"
os: ubuntu-latest
gemfile: Gemfile-rails-edge
experimental: true
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Setup Code Climate test-reporter
if: ${{ contains(github.ref, 'main') }}
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Ruby specs
run: bundle exec rspec
- name: Upload code coverage to Code Climate
if: ${{ contains(github.ref, 'main') }}
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}}
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3.5"
bundler-cache: true
- name: Ruby linter
run: bundle exec standardrb
js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4.0.0
with:
version: 9.8.0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test