Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First stab at GitHub Actions #1051

Merged
merged 9 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 0 additions & 164 deletions .circleci/config.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .circleci/setup-rubygems.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ note that so we can add it to the [Changelog][].
### Required Checks

Before pushing your code and opening a PR, we recommend you run the following checks to avoid
our CircleCI Workflow to block your contribution.
our GitHub Actions Workflow to block your contribution.

```bash
# Run unit tests and check code coverage
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on: [push]

env:
GIT_COMMIT_SHA: ${{ github.sha }}
GIT_BRANCH: ${{ github.ref }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

jobs:
linting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Rubocop
run: |
gem install rubocop rubocop-performance --no-document
rubocop --require rubocop-performance --format progress

- name: Yard-Junk
run: |
gem install yard-junk --no-document
yard-junk --path lib

build:
needs: [linting]
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.3.x, 2.4.x, 2.5.x, 2.6.x]

steps:
- uses: actions/checkout@v1

- name: Install dependencies
run: |
sudo apt-get install libcurl4-openssl-dev

- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Build
run: |
gem install bundler
bundle install --jobs 4 --retry 3

- name: Setup Code Climate
if: matrix.ruby == '2.6.x'
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build

- name: Test
run: bundle exec rake

- name: Run Code Climate Test Reporter
if: success() && matrix.ruby == '2.6.x'
run: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish

on:
release:
types: [published]

jobs:
build:
name: Publish to Rubygems
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
version: 2.6.x

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build faraday.gemspec
gem push faraday-*.gem
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ![Faraday](./docs/assets/img/repo-card-slim.png)

[![Gem Version](https://badge.fury.io/rb/faraday.svg)](https://rubygems.org/gems/faraday)
[![CircleCI](https://circleci.com/gh/lostisland/faraday/tree/master.svg?style=svg)](https://circleci.com/gh/lostisland/faraday/tree/master)
![GitHub Actions CI](https://github.com/lostisland/faraday/workflows/CI/badge.svg)
[![Test Coverage](https://api.codeclimate.com/v1/badges/f869daab091ceef1da73/test_coverage)](https://codeclimate.com/github/lostisland/faraday/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/f869daab091ceef1da73/maintainability)](https://codeclimate.com/github/lostisland/faraday/maintainability)
[![Gitter](https://badges.gitter.im/lostisland/faraday.svg)](https://gitter.im/lostisland/faraday?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
Expand All @@ -18,7 +18,7 @@ Need more details? See the [Faraday API Documentation][apidoc] to see how it wor

## Supported Ruby versions

This library aims to support and is [tested against][circle_ci] the following Ruby
This library aims to support and is [tested against][actions] the following Ruby
implementations:

* Ruby 2.3+
Expand Down Expand Up @@ -49,7 +49,7 @@ But before you start coding, please read our [Contributing Guide][contributing]
[faraday_team]: https://lostisland.github.io/faraday/team
[contributing]: https://github.com/lostisland/faraday/blob/master/.github/CONTRIBUTING.md
[apidoc]: http://www.rubydoc.info/gems/faraday
[circle_ci]: https://circleci.com/gh/lostisland/faraday
[actions]: https://github.com/lostisland/faraday/actions
[jruby]: http://jruby.org/
[rubinius]: http://rubini.us/
[license]: LICENSE.md