From 5d138b0c78e35638ef39f6aeda663a1a215ebb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=A0im=C3=A1nek?= Date: Wed, 9 Apr 2025 22:32:08 +0200 Subject: [PATCH] Simplify setup and use GitHub Actions for CI. --- .circleci/config.yml | 14 -------------- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ Dockerfile | 9 --------- Makefile | 14 -------------- README.md | 13 ++++++------- bin/run-image | 6 ------ 6 files changed, 36 insertions(+), 50 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build.yml delete mode 100644 Dockerfile delete mode 100644 Makefile delete mode 100755 bin/run-image diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 5d67b45..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2.0 - -jobs: - build: - machine: true - working_directory: ~/simplecov-json-formatter - steps: - - checkout - - run: - name: Build - command: make image - - run: - name: Test - command: make test diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4296947 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + rspec: + name: Ruby ${{ matrix.ruby }} Specs + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + ruby: ["3.1", "3.2", "3.3", "3.4"] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Run tests + run: bundle exec rspec diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 314c02e..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM ruby:2.5 - -WORKDIR /gem - -COPY . . - -RUN apt-get update -y && \ - gem install bundler:2.1.0 && \ - bundle install diff --git a/Makefile b/Makefile deleted file mode 100644 index d6aaa37..0000000 --- a/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -.PHONY: image test format sh - -image: - docker image build -t simplecov-json-formatter . - -test: - ./bin/run-image rake - -format: - ./bin/run-image rubocop -a - -sh: - ./bin/run-image sh - diff --git a/README.md b/README.md index a6dbb4a..d7f793b 100644 --- a/README.md +++ b/README.md @@ -10,19 +10,18 @@ You can expect for this gem to produce a `coverage.json` file, located at the `c Depending on your `SimpleCoV`'s settings you will experiment different outcomes. Particularly depending on which type of coverage are you running `SimpleCov` with: -- If you configure `SimpleCov` to run with `branch` coverage you should expect an output formatted like [sample_with_branch.json](https://github.com/fede-moya/simplecov_json_formatter/blob/master/spec/fixtures/sample_with_branch.json) -- Otherwise you should expect an output formatted like [sample.json](https://github.com/fede-moya/simplecov_json_formatter/blob/master/spec/fixtures/sample.json) +- If you configure `SimpleCov` to run with `branch` coverage you should expect an output formatted like [sample_with_branch.json](https://github.com/codeclimate-community/simplecov_json_formatter/blob/master/spec/fixtures/sample_with_branch.json) +- Otherwise you should expect an output formatted like [sample.json](https://github.com/codeclimate-community/simplecov_json_formatter/blob/master/spec/fixtures/sample.json) ## Development -We encourage you to use docker for common operations like running tests, or debugging your code. Running `make sh` will start a new container instance based on the `Dockerfile` provided at root, finally a shell prompt will be displayed on your terminal. Also, syncronization with your local files will be already set. +### Setup -### Tests -`make test` will trigger the excution of both running tests and running rubocop as linter, by simply running `rake`, this actions will be run inside a new container but using your local files. +Run `bundle install` to install dependencies needed for local development. -### Format +### Tests -`make format` will run `rubocop -a` which stands for _autocorrect_ and format your code according to the `.rubocop.yml` config file. +`bundle exec rspec` will trigger the excution of running tests. ## Copyright diff --git a/bin/run-image b/bin/run-image deleted file mode 100755 index 3051386..0000000 --- a/bin/run-image +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -exec docker run \ - -it --rm \ - --volume "$PWD:/gem" \ - simplecov-json-formatter "$@"