Skip to content

Commit

Permalink
Migrate CI from Travis to GitHub Actions (#62)
Browse files Browse the repository at this point in the history
* Use GitHub Actions as CI

* Remove Travis CI usage

* Ignore bundle directory

* Replace Travis CI badge with GitHub Actions

* Run test with Ruby 2.7 only
  • Loading branch information
mathroule authored Nov 19, 2023
1 parent b82fb46 commit a01c218
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 17 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Danger
on:
pull_request:
types: [ opened, reopened, edited, synchronize ]
jobs:
danger:
name: Danger
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run Danger
run: |
# the personal token is public, this is ok, base64 encode to avoid tripping Github
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint
on: [ push, pull_request ]
jobs:
rubocop:
name: RuboCop
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: RuboCop
run: bundle exec rubocop
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test
on: [ push, pull_request ]
jobs:
test:
name: Test (Ruby ${{ matrix.ruby-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: [ '2.7' ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run test
run: bundle exec rake spec
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pkg
.idea/
Gemfile.lock
.yardoc
vendor/bundle
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ git push origin my-feature-branch -f

### Check on Your Pull Request

Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
Go back to your pull request after a few minutes and see whether it passed muster with GitHub Actions. Everything should look green, otherwise fix issues and amend your commit as described above.

### Be Patient

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A plugin for [danger.systems](http://danger.systems) that obsessive-compulsively
It can make sure, for example, that changes are attributed properly, have a valid version number, a date in the ISO8601 format, balanced parenthesis and brackets, and that they’re always terminated with a period.

[![Gem Version](https://badge.fury.io/rb/danger-changelog.svg)](https://badge.fury.io/rb/danger-changelog)
[![Build Status](https://travis-ci.org/dblock/danger-changelog.svg?branch=master)](https://travis-ci.org/dblock/danger-changelog)
[![Build Status](https://github.com/dblock/danger-changelog/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/dblock/danger-changelog/actions/workflows/test.yml)

# Table of Contents

Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bundle install
rake
```

Check that the last build succeeded in [Travis CI](https://travis-ci.org/dblock/danger-changelog) for all supported platforms.
Check that the last build succeeded in [GitHub Actions](https://github.com/dblock/danger-changelog/actions) for all supported platforms.

Increment the version, modify [lib/changelog/gem_version.rb](lib/changelog/gem_version.rb).

Expand Down

0 comments on commit a01c218

Please sign in to comment.