From 3b782b599e11a4e350017dfe31a1b8eed429bf71 Mon Sep 17 00:00:00 2001 From: Erik Berlin Date: Wed, 25 Oct 2023 15:54:08 -0700 Subject: [PATCH] Split tasks into separate workflows --- .github/workflows/lint.yml | 29 ++++++++++++++++++++++++++ .github/workflows/mutant.yml | 29 ++++++++++++++++++++++++++ .github/workflows/{ci.yml => test.yml} | 4 ++-- .github/workflows/type_check.yml | 29 ++++++++++++++++++++++++++ README.md | 5 +++++ Rakefile | 5 ++++- 6 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/mutant.yml rename .github/workflows/{ci.yml => test.yml} (90%) create mode 100644 .github/workflows/type_check.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..c521852 --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/mutant.yml b/.github/workflows/mutant.yml new file mode 100644 index 0000000..4c94848 --- /dev/null +++ b/.github/workflows/mutant.yml @@ -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 mutant diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 90% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index 018af6e..27d47d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Ruby +name: Tests on: push: @@ -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 diff --git a/.github/workflows/type_check.yml b/.github/workflows/type_check.yml new file mode 100644 index 0000000..419becd --- /dev/null +++ b/.github/workflows/type_check.yml @@ -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 diff --git a/README.md b/README.md index 15fb040..865be3d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +![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) + # A [Ruby](https://www.ruby-lang.org) interface to the [X API](https://developer.x.com) ## Follow diff --git a/Rakefile b/Rakefile index 21ec68b..6752544 100644 --- a/Rakefile +++ b/Rakefile @@ -28,4 +28,7 @@ task :mutant do system(*%w[bundle exec mutant run]) or raise "Mutant task failed" end -task default: %i[test rubocop standard mutant steep] +desc "Run linters" +task lint: %i[rubocop standard] + +task default: %i[test lint mutant steep]