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

switch ci from travis to actions #1691

Merged
merged 5 commits into from
May 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .travis.sh → .actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ echo "Running sinatra tests..."
bundle exec rake

echo "Running sinatra-contrib tests..."
export BUILDIR=$TRAVIS_BUILD_DIR/sinatra-contrib
export BUILDIR=$GITHUB_WORKSPACE/sinatra-contrib

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require 'sinatra'
get '/frank-says' do
'Put this in your pipe & smoke it!'
end

export BUNDLE_GEMFILE=$BUILDIR/Gemfile
cd $BUILDIR
bundle install --jobs=3 --retry=3
bundle exec rake

echo "Running rack-protection tests..."
export BUILDIR=$TRAVIS_BUILD_DIR/rack-protection
export BUILDIR=$GITHUB_WORKSPACE/rack-protection
export BUNDLE_GEMFILE=$BUILDIR/Gemfile
cd $BUILDIR
bundle install --jobs=3 --retry=3
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Testing

on:
push:
branches:
- master
pull_request:

jobs:
test:
name: Test with Ruby-${{ matrix.ruby }}
runs-on: ubuntu-latest
strategy:
matrix:
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
# TODO: Add jruby if something like allow_failures will be implemented on Actions.
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', head]
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
namusyaka marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install dependencies
run: sudo apt-get install -y pandoc nodejs pkg-config libxml2-dev libxslt-dev
- name: Run tests
run: ./.actions.sh

# TODO(zzak, rkh): Add slack notification.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zzak Probably we need to set up an integration with slack but I don't have a permission to generate a token on slack. Could you work on this?

34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.