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

replace travis config with gh actions #1055

Merged
merged 5 commits into from
Oct 17, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
69 changes: 46 additions & 23 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
## Contributing

You can run the test suite against a live server by running `script/test`. It
automatically starts a test server in background. Only tests in
`test/adapters/*_test.rb` require a server, though.
In Faraday we always welcome new ideas and features, however we also have to ensure
that the overall code quality stays on reasonable levels.
For this reason, before adding any contribution to Faraday, we highly recommend reading this
quick guide to ensure your PR can be reviewed and approved as quickly as possible.

We are pushing towards a 1.0 release, when we will have to follow [Semantic
Versioning][semver]. If your patch includes changes to break compatibility,
note that so we can add it to the [Changelog][].

``` sh
# setup development dependencies
$ script/bootstrap

# run the whole suite
$ script/test
### Required Checks

# run only specific files
$ script/test excon patron
Before pushing your code and opening a PR, we recommend you run the following checks to avoid
our GitHub Actions Workflow to block your contribution.

# run tests using SSL
$ SSL=yes script/test
```bash
# Run unit tests and check code coverage
$ bundle exec rspec

# Run Rubocop and check code style
$ bundle exec rubocop
```


### New Features

When adding a feature Faraday:
When adding a feature in Faraday:

1. also add tests to cover your new feature.
2. if the feature is for an adapter, the **attempt** must be made to add the same feature to all other adapters as well.
3. start opening an issue describing how the new feature will work, and only after receiving the green light by the core team start working on the PR.
3. start opening an issue describing how the new feature will work, and only after receiving
the green light by the core team start working on the PR.

### New Middlewares

### New Middleware

We will accept middleware that:

1. is useful to a broader audience, but can be implemented relatively
simple; and
1. is useful to a broader audience, but can be implemented relatively simple; and
2. which isn't already present in [faraday_middleware][] project.


Expand All @@ -43,10 +50,26 @@ We will accept adapters that:
1. are proven and may have better performance than existing ones; or
2. if they have features not present in included adapters.

We are pushing towards a 1.0 release, when we will have to follow [Semantic
Versioning][semver]. If your patch includes changes to break compatibility,
note that so we can add it to the [Changelog][].

[semver]: http://semver.org/
[changelog]: https://github.com/lostisland/faraday/releases
[faraday_middleware]: https://github.com/lostisland/faraday_middleware/wiki
### Changes to Faraday Website

The [Faraday Website][website] is included in the Faraday repository, under the `/docs` folder.
If you want to apply changes to it, please test it locally using `Jekyll`.

```bash
# Navigate into the /docs folder
$ cd docs

# Install Jekyll dependencies, this bundle is different from Faraday's one.
$ bundle install

# Run the Jekyll server with the Faraday website
$ bundle exec jekyll serve

# The site will now be reachable at http://127.0.0.1:4000/faraday/
```

[semver]: http://semver.org/
[changelog]: https://github.com/lostisland/faraday/releases
[faraday_middleware]: https://github.com/lostisland/faraday_middleware
[website]: https://lostisland.github.io/faraday
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:

push:
branches: [master, 0.1x]

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

jobs:
build:
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: Test
run: bundle exec rake
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 }}
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.