mirror of
https://github.com/samsonjs/wordexp.git
synced 2026-03-25 08:45:54 +00:00
Replace CirclceCI with GitHub Actions
This commit is contained in:
parent
02eefab94f
commit
33f7bdbacb
2 changed files with 53 additions and 81 deletions
|
|
@ -1,81 +0,0 @@
|
|||
version: 2.1
|
||||
executors:
|
||||
ruby:
|
||||
parameters:
|
||||
version:
|
||||
description: "Ruby version number"
|
||||
default: "4.0.0"
|
||||
type: string
|
||||
docker:
|
||||
- image: cimg/ruby:<< parameters.version >>
|
||||
|
||||
commands:
|
||||
bundle_install:
|
||||
description: Install Ruby dependencies with Bundler
|
||||
parameters:
|
||||
version:
|
||||
description: "Ruby version number"
|
||||
default: "4.0.0"
|
||||
type: string
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- bundle-v1-{{ arch }}-<< parameters.version >>
|
||||
- run:
|
||||
name: Install Ruby Dependencies
|
||||
command: |
|
||||
bundle config --local path vendor/bundle
|
||||
bundle check || (bundle install --jobs=8 --retry=3 && bundle clean)
|
||||
- save_cache:
|
||||
paths:
|
||||
- ./vendor/bundle
|
||||
key: bundle-v1-{{ arch }}-<< parameters.version >>-{{ checksum "Gemfile.lock" }}
|
||||
|
||||
jobs:
|
||||
rubocop:
|
||||
executor: ruby
|
||||
steps:
|
||||
- checkout
|
||||
- bundle_install
|
||||
- run: bundle exec rubocop
|
||||
|
||||
test:
|
||||
parameters:
|
||||
version:
|
||||
description: "Ruby version number"
|
||||
default: "4.0.0"
|
||||
type: string
|
||||
executor:
|
||||
name: ruby
|
||||
version: << parameters.version >>
|
||||
steps:
|
||||
- checkout
|
||||
- bundle_install:
|
||||
version: << parameters.version >>
|
||||
- run: bundle exec rake test
|
||||
- store_test_results:
|
||||
path: ./reports
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
commit-workflow:
|
||||
jobs:
|
||||
- rubocop
|
||||
- test:
|
||||
matrix:
|
||||
parameters:
|
||||
version: ["3.2.9", "3.3.10", "3.4.8", "4.0.0"]
|
||||
cron-workflow:
|
||||
jobs:
|
||||
- rubocop
|
||||
- test:
|
||||
matrix:
|
||||
parameters:
|
||||
version: ["3.2.9", "3.3.10", "3.4.8", "4.0.0"]
|
||||
triggers:
|
||||
- schedule:
|
||||
cron: "0 13 * * 6"
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
53
.github/workflows/ci.yml
vendored
Normal file
53
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
rubocop:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 4.0.0
|
||||
- name: Cache Ruby gems
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-bundle-4.0.0-${{ hashFiles('Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bundle-4.0.0-
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
bundle config set --local path vendor/bundle
|
||||
bundle install --jobs 8 --retry 3
|
||||
- name: Run RuboCop
|
||||
run: bundle exec rubocop
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
ruby-version: ["3.2.9", "3.3.10", "3.4.8", "4.0.0"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby-version }}
|
||||
- name: Cache Ruby gems
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-bundle-${{ matrix.ruby-version }}-${{ hashFiles('Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bundle-${{ matrix.ruby-version }}-
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
bundle config set --local path vendor/bundle
|
||||
bundle install --jobs 8 --retry 3
|
||||
- name: Run tests
|
||||
run: bundle exec rake test
|
||||
Loading…
Reference in a new issue