Skip to content

Commit

Permalink
Merge pull request #694 from openSUSE/ci-rubocop
Browse files Browse the repository at this point in the history
Run the Rubocop CI check only when a Ruby file is changed
  • Loading branch information
lslezak authored Aug 9, 2023
2 parents 4df4c55 + 766f3dd commit e9bff87
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 23 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci-rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "CI - Rubocop"

on:
push:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used below for the pull request event. Keep both lists in sync!!

# this file as well
- .github/workflows/ci-rubocop.yml
# Rubocop configuration
- service/.rubocop.yml
# all Ruby files
- service/Gemfile
- service/bin/**
- service/**.rb

pull_request:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used above for the push event. Keep both lists in sync!!

# this file as well
- .github/workflows/ci-rubocop.yml
# Rubocop configuration
- service/.rubocop.yml
# all Ruby files
- service/Gemfile
- service/bin/**
- service/**.rb

jobs:
rubocop:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./service

strategy:
fail-fast: false
matrix:
distro: [ "leap_latest" ]

container:
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby

steps:

- name: Git Checkout
uses: actions/checkout@v3

- name: Rubocop
run: /usr/bin/rubocop.*-1.24.1
23 changes: 0 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,29 +98,6 @@ jobs:
flag-name: backend
parallel: true

ruby_linter:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./service

strategy:
fail-fast: false
matrix:
distro: [ "leap_latest" ]

container:
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby

steps:

- name: Git Checkout
uses: actions/checkout@v3

- name: Rubocop
run: /usr/bin/rubocop.*-1.24.1

ruby_doc:
runs-on: ubuntu-latest
env:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**Checks**

[![CI Status](https://github.com/openSUSE/agama/actions/workflows/ci.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/ci.yml)
[![CI - Rubocop](https://github.com/openSUSE/agama/actions/workflows/ci-rubocop.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/ci-rubocop.yml)
[![CI - Integration Tests](https://github.com/openSUSE/agama/actions/workflows/ci-integration-tests.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/ci-integration-tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/openSUSE/agama/badge.svg?branch=master)](https://coveralls.io/github/openSUSE/agama?branch=master)
[![GitHub Pages](https://github.com/openSUSE/agama/actions/workflows/github-pages.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/github-pages.yml)
Expand Down

0 comments on commit e9bff87

Please sign in to comment.