Merge pull request #58 from dry-rb/devtools

Migrate to use dry-rb/devools for GH actions/workflows/common files sync
This commit is contained in:
Piotr Solnica 2019-12-07 10:50:10 +01:00 committed by GitHub
commit 14b7f3b246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 211 additions and 195 deletions

View File

@ -1,167 +0,0 @@
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
jobs:
"ruby-2.3":
docker:
- image: hanami/ruby-2.3
working_directory: ~/hanami-utils
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Gemfile.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: install dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
paths:
- ./vendor/bundle
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
# run tests!
- run:
name: run tests
command: |
./script/ci
"ruby-2.4":
docker:
- image: hanami/ruby-2.4
working_directory: ~/hanami-utils
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Gemfile.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: install dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
paths:
- ./vendor/bundle
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
# run tests!
- run:
name: run tests
command: |
./script/ci
"ruby-2.5":
docker:
- image: hanami/ruby-2.5
working_directory: ~/hanami-utils
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Gemfile.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: install dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
paths:
- ./vendor/bundle
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
# run tests!
- run:
name: run tests
command: |
./script/ci
"ruby-2.6":
docker:
- image: hanami/ruby-2.6
working_directory: ~/hanami-utils
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Gemfile.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: install dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
paths:
- ./vendor/bundle
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
# run tests!
- run:
name: run tests
command: |
./script/ci
"jruby-9.1":
docker:
- image: hanami/jruby-9.1
working_directory: ~/hanami-utils
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Gemfile.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: install dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
paths:
- ./vendor/bundle
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
# run tests!
- run:
name: run tests
command: |
./script/ci
"jruby-9.2":
docker:
- image: hanami/jruby-9.2
working_directory: ~/hanami-utils
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Gemfile.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: install dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle
- save_cache:
paths:
- ./vendor/bundle
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
# run tests!
- run:
name: run tests
command: |
./script/ci
workflows:
version: 2
build:
jobs:
- "ruby-2.3"
- "ruby-2.4"
- "ruby-2.5"
- "ruby-2.6"
- "jruby-9.1"
- "jruby-9.2"

View File

@ -0,0 +1,10 @@
---
name: "⚠️ Please don't ask for support via issues"
about: See CONTRIBUTING.md for more information
title: ''
labels: ''
assignees: ''
---

30
.github/ISSUE_TEMPLATE/---bug-report.md vendored Normal file
View File

@ -0,0 +1,30 @@
---
name: "\U0001F41B Bug report"
about: See CONTRIBUTING.md for more information
title: ''
labels: bug
assignees: ''
---
**Before you submit this: WE ONLY ACCEPT BUG REPORTS AND FEATURE REQUESTS**
For more information see [our contribution guidelines](https://github.com/dry-rb/dry-cli/blob/master/CONTRIBUTING.md)
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Provide detailed steps to reproduce, an executable script would be best.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Your environment**
- Affects my production application: **YES/NO**
- Ruby version: ...
- OS: ...

View File

@ -0,0 +1,18 @@
---
name: "\U0001F6E0 Feature request"
about: See CONTRIBUTING.md for more information
title: ''
labels: feature
assignees: ''
---
Summary of what the feature is supposed to do.
## Examples
Code examples showing how the feature could be used.
## Resources
Additional information, like a link to the discussion forum thread where the feature was discussed etc.

77
.github/workflows/custom_ci.yml vendored Normal file
View File

@ -0,0 +1,77 @@
# this file is managed by dry-rb/devtools project
name: ci
on:
push:
paths:
- .github/workflows/ci.yml
- lib/**
- spec/**
- Gemfile
- "*.gemspec"
pull_request:
branches:
- master
jobs:
tests-mri:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["2.6.x", "2.5.x", "2.4.x"]
include:
- ruby: "2.6.x"
coverage: "true"
steps:
- uses: actions/checkout@v1
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
- name: Download test reporter
if: "matrix.coverage == 'true'"
run: |
mkdir -p tmp/
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
chmod +x ./tmp/cc-test-reporter
./tmp/cc-test-reporter before-build
- name: Run all tests
env:
COVERAGE: ${{matrix.coverage}}
run: |
gem install bundler
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
script/ci
- name: Send coverage results
if: "matrix.coverage == 'true'"
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
GIT_COMMIT_SHA: ${{github.sha}}
GIT_BRANCH: ${{github.ref}}
GIT_COMMITTED_AT: ${{github.event.head_commit.timestamp}}
run: |
GIT_BRANCH=`ruby -e "puts ENV['GITHUB_REF'].split('/', 3).last"` \
GIT_COMMITTED_AT=`ruby -r time -e "puts Time.iso8601(ENV['GIT_COMMITTED_AT']).to_i"` \
./tmp/cc-test-reporter after-build
tests-others:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image: ["jruby:9.2.8", "ruby:rc"]
container:
image: ${{matrix.image}}
steps:
- uses: actions/checkout@v1
- name: Install git
run: |
apt-get update
apt-get install -y --no-install-recommends git
- name: Run all tests
run: |
gem install bundler
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
script/ci

34
.github/workflows/docsite.yml vendored Normal file
View File

@ -0,0 +1,34 @@
# this file is managed by dry-rb/devtools project
name: docsite
on:
push:
paths:
- docsite/**
- .github/workflows/docsite.yml
branches:
- master
- release-**
tags:
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: "2.6.x"
- name: Install dependencies
run: |
gem install bundler
bundle install --jobs 4 --retry 3 --without benchmarks sql
- name: Symlink ossy
run: mkdir -p bin && ln -sf "$(bundle show ossy)/bin/ossy" bin/ossy
- name: Trigger dry-rb.org deploy
env:
GITHUB_LOGIN: dry-bot
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
run: bin/ossy github workflow dry-rb/dry-rb.org ci

34
.github/workflows/sync_configs.yml vendored Normal file
View File

@ -0,0 +1,34 @@
# this file is managed by dry-rb/devtools project
name: sync_configs
on:
repository_dispatch:
jobs:
sync-configs:
runs-on: ubuntu-latest
if: github.event.action == 'sync_configs'
steps:
- uses: actions/checkout@v1
- name: Update configuration files from devtools
env:
GITHUB_LOGIN: dry-bot
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
run: |
git clone https://github.com/dry-rb/devtools.git tmp/devtools
if [ -f ".github/workflows/custom_ci.yml" ]; then
rsync -av --exclude '.github/workflows/ci.yml' tmp/devtools/shared/ . ;
else
rsync -av tmp/devtools/shared/ . ;
fi
git config --local user.email "dry-bot@dry-rb.org"
git config --local user.name "dry-bot"
git add -A
git commit -m "[devtools] config sync" || echo "nothing changed"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PAT }}

View File

@ -1,28 +0,0 @@
language: ruby
sudo: false
cache: bundler
before_script:
- gem update --system
script: ./script/ci
rvm:
- 2.3.8
- 2.4.5
- 2.5.3
- 2.6.0
- jruby-9.1.9.0
- ruby-head
- jruby-head
matrix:
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
- rvm: jruby-9.1.9.0
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/fde2367248d53de4fe70
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always

View File

@ -1,3 +1,11 @@
if ENV['COVERAGE']
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
end
$LOAD_PATH.unshift "lib"
require "hanami/utils"
require "hanami/devtools/unit"