2025年5月25日日曜日

Github Action で rspec を実行する方法

Github Action で rspec を実行する方法

概要

.ruby-version がある場合は ruby-version の指定は不要です

環境

  • Github Action (2025/05/15時点)

.github/workflows/rubocop.yml

name: RuboCop Linter

on:
  push:
    branches:
      - "master"

jobs:
  rubocop:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
	      # ruby-version: '3.4'
          bundler-cache: true
      - name: Run RuboCop
        run: bundle exec rubocop

最後に

参考サイト他のジョブと依存性を持たせたい場合は workflow_run を使いましょう

0 件のコメント:

コメントを投稿