Skip to content

Commit

Permalink
Split tasks into separate workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Oct 25, 2023
1 parent af5d907 commit aa36d28
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Linter

on:
push:
branches:
- main

pull_request:

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- "3.0"
- "3.1"
- "3.2"

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake lint
29 changes: 29 additions & 0 deletions .github/workflows/mutant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Mutant

on:
push:
branches:
- main

pull_request:

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- "3.0"
- "3.1"
- "3.2"

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake coverage
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ruby
name: Tests

on:
push:
Expand Down Expand Up @@ -26,4 +26,4 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
run: bundle exec rake test
29 changes: 29 additions & 0 deletions .github/workflows/type_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Type Checker

on:
push:
branches:
- main

pull_request:

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- "3.0"
- "3.1"
- "3.2"

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake steep
2 changes: 2 additions & 0 deletions .mutant.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
coverage_criteria:
process_abort: true
fail_fast: true
includes:
- lib
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
![Tests](https://github.com/sferik/x-ruby/actions/workflows/test.yml/badge.svg)
![Linter](https://github.com/sferik/x-ruby/actions/workflows/lint.yml/badge.svg)
![Mutant](https://github.com/sferik/x-ruby/actions/workflows/mutant.yml/badge.svg)
![Typer Checker](https://github.com/sferik/x-ruby/actions/workflows/type_check.yml/badge.svg)
[![Gem Version](https://badge.fury.io/rb/x.svg)](https://rubygems.org/gems/x)

# A [Ruby](https://www.ruby-lang.org) interface to the [X API](https://developer.x.com)

## Follow
Expand Down
8 changes: 7 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ task :mutant do
system(*%w[bundle exec mutant run]) or raise "Mutant task failed"
end

task default: %i[test rubocop standard mutant steep]
desc "Test and mutation coverage"
task coverage: %i[test mutant]

desc "Run linters"
task lint: %i[rubocop standard]

task default: %i[test lint mutant steep]

0 comments on commit aa36d28

Please sign in to comment.