81 lines
2.0 KiB
YAML
81 lines
2.0 KiB
YAML
# this file is managed by dry-rb/devtools project
|
|
|
|
name: Tests
|
|
|
|
"on":
|
|
push:
|
|
paths:
|
|
- .github/workflows/ci.yml
|
|
- lib/**
|
|
- spec/**
|
|
- Rakefile
|
|
- Gemfile
|
|
- Gemfile.devtools
|
|
- ".rubocop.yml"
|
|
- project.yml
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
create:
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
ruby:
|
|
- "2.7"
|
|
- "2.6"
|
|
- "2.5"
|
|
- "2.4"
|
|
- "jruby"
|
|
include:
|
|
- ruby: "2.6"
|
|
coverage: "true"
|
|
env:
|
|
CLASSPATH: "" # tmp jruby build workaround
|
|
COVERAGE: ${{matrix.coverage}}
|
|
CODACY_RUN_LOCAL: true
|
|
CODACY_PROJECT_TOKEN: ${{secrets.CODACY_PROJECT_TOKEN}}
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Set up Ruby
|
|
uses: eregon/use-ruby-action@master
|
|
with:
|
|
ruby-version: ${{matrix.ruby}}
|
|
- name: Install latest bundler
|
|
run: |
|
|
gem install bundler
|
|
bundle config set without 'tools benchmarks docs'
|
|
- name: Bundle install
|
|
run: bundle install --jobs 4 --retry 3
|
|
- name: Run all tests
|
|
run: bundle exec rake
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
if: contains(github.ref, 'tags')
|
|
needs: tests
|
|
env:
|
|
GITHUB_LOGIN: dry-bot
|
|
GITHUB_TOKEN: ${{secrets.GH_PAT}}
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Set up Ruby
|
|
uses: eregon/use-ruby-action@master
|
|
with:
|
|
ruby-version: 2.6
|
|
- name: Install latest bundler
|
|
run: |
|
|
gem install bundler
|
|
- name: Bundle
|
|
run: |
|
|
bundle install
|
|
- name: Symlink ossy
|
|
run: |
|
|
ln -sf "$(bundle info ossy --path)/bin/ossy" bin/ossy
|
|
- name: Trigger release workflow
|
|
run: |
|
|
tag=$(echo $GITHUB_REF | cut -d / -f 3)
|
|
bundle exec bin/ossy gh w $GITHUB_REPOSITORY release --payload "{\"tag\":\"$tag\",\"tag_creator\":\"$GITHUB_ACTOR\",\"repo\":\"$GITHUB_REPOSITORY\"}"
|