diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a962af0..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,93 +0,0 @@ -# Ruby CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-ruby/ for more details -# -version: 2.1 - -orbs: - codeclimate: sue445/codeclimate@volatile - slack: circleci/slack@3 - -executors: - ruby: - parameters: - tag: - type: string - default: "latest" - docker: - - image: ruby:<< parameters.tag >> - environment: - # c.f. https://github.com/ffaker/ffaker/issues/277#issuecomment-263519146 - LANG: en_US.UTF-8 - LANGUAGE: en_US.UTF-8 - LC_ALL: C.UTF-8 - - BUNDLE_PATH: vendor/bundle - BUNDLE_JOBS: 4 - CC_TEST_REPORTER_ID: d91e7c9665019f1574eb4c5a3de1547c80bc3062e3c297282f106501a3c5c694 - working_directory: ~/app - -commands: - bundle_install: - steps: - - run: bundle config --local path vendor/bundle - - run: bundle install --jobs=4 --retry=3 - -jobs: - rspec: - parameters: - version: - type: string - executor: - name: ruby - tag: << parameters.version >> - steps: - - checkout - - run: ruby --version - - run: bundle --version - - run: gem --version - - bundle_install - - codeclimate/with-cc-test-reporter: - after_build_args: "--coverage-input-type simplecov" - steps: - - run: bundle exec rspec - - slack/notify-on-failure - - rubocop: - executor: - name: ruby - tag: "2.5" - - steps: - - checkout - - bundle_install - - run: bundle exec rubocop - - slack/notify-on-failure - -build_jobs: &build_jobs - - rspec: - matrix: - parameters: - version: - - "2.5" - - "2.6" - - "2.7" - - "3.0" - - "3.1" - - "3.2" - - rubocop - -workflows: - version: 2 - - build: - jobs: *build_jobs - - weekly_build: - triggers: - - schedule: - cron: "00 10 * * 5" # JST 19:00 (Fri) - filters: - branches: - only: master - jobs: *build_jobs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0100e63 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,91 @@ +name: test + +on: + push: + branches: + - master + pull_request: + types: + - opened + - synchronize + - reopened + schedule: + - cron: "0 10 * * 5" # JST 19:00 (Fri) + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + ruby: + - "2.5" + - "2.6" + - "2.7" + - "3.0" + - "3.1" + - "3.2" + + steps: + - uses: actions/checkout@v3 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: bundle update + run: | + set -xe + bundle config path vendor/bundle + bundle update --jobs $(nproc) --retry 3 + + - name: Setup Code Climate Test Reporter + uses: aktions/codeclimate-test-reporter@v1 + with: + codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }} + command: before-build + continue-on-error: true + + - run: bundle exec rspec + + - name: Teardown Code Climate Test Reporter + uses: aktions/codeclimate-test-reporter@v1 + with: + codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }} + command: after-build + if: always() + continue-on-error: true + + - run: bundle exec rubocop + + - name: Slack Notification (not success) + uses: lazy-actions/slatify@master + if: "! success()" + continue-on-error: true + with: + job_name: ${{ format('*build* ({0})', matrix.ruby) }} + type: ${{ job.status }} + icon_emoji: ":octocat:" + url: ${{ secrets.SLACK_WEBHOOK }} + token: ${{ secrets.GITHUB_TOKEN }} + + notify: + needs: + - test + + runs-on: ubuntu-latest + + steps: + - name: Slack Notification (success) + uses: lazy-actions/slatify@master + if: always() + continue-on-error: true + with: + job_name: '*build*' + type: ${{ job.status }} + icon_emoji: ":octocat:" + url: ${{ secrets.SLACK_WEBHOOK }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 61540e9..635a965 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 5ch (a.k.a. 2ch) reader via http://itest.5ch.net/ [![Gem Version](https://badge.fury.io/rb/itest5ch.svg)](https://badge.fury.io/rb/itest5ch) -[![CircleCI](https://circleci.com/gh/sue445/itest5ch/tree/master.svg?style=svg)](https://circleci.com/gh/sue445/itest5ch/tree/master) +[![test](https://github.com/sue445/itest5ch/actions/workflows/test.yml/badge.svg)](https://github.com/sue445/itest5ch/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/sue445/itest5ch/badge.svg)](https://coveralls.io/github/sue445/itest5ch) [![Maintainability](https://api.codeclimate.com/v1/badges/14a81b3f7da11e475242/maintainability)](https://codeclimate.com/github/sue445/itest5ch/maintainability)