From 8f54cb9268b84c03e4cfe9566880fa1819732615 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 29 Apr 2021 13:37:11 +0200 Subject: [PATCH] Use GitHub Actions for CI --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 21 -------------------- Dockerfile | 21 -------------------- Rakefile | 36 ++++++++++----------------------- 4 files changed, 54 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100644 Dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fae1f4c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: [push, pull_request] + +jobs: + rubies: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: [ ruby-head, '3.0', '2.7', '2.6', '2.5', '2.4', '2.3', '2.2' ] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + run: bundle install + - name: Run test + run: rake + - name: Install gem + run: rake install + platforms: + strategy: + matrix: + os: [macos, windows] + ruby: ['3.0'] + runs-on: ${{ matrix.os }}-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: Install dependencies + run: bundle install + - name: Run test + run: rake + - name: Install gem + run: rake install diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b5c8b50..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: required - -services: - - docker - -language: general - -env: - matrix: - - RVM_RUBY_VERSION=2.2 - - RVM_RUBY_VERSION=2.3 - - RVM_RUBY_VERSION=2.4 - - RVM_RUBY_VERSION=2.5 - - RVM_RUBY_VERSION=2.6 - - RVM_RUBY_VERSION=ruby-head - -before_install: -- sudo docker build -t stackprof-$RVM_RUBY_VERSION --build-arg=RVM_RUBY_VERSION=$RVM_RUBY_VERSION . - -script: -- sudo docker run --name stackprof-$RVM_RUBY_VERSION stackprof-$RVM_RUBY_VERSION diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 7c10796..0000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM ubuntu:16.04 -ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update -q && \ - apt-get install -qy \ - curl ca-certificates gnupg2 dirmngr build-essential \ - gawk git autoconf automake pkg-config \ - bison libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libtool \ - libyaml-dev sqlite3 zlib1g-dev libgmp-dev libreadline-dev libssl-dev \ - ruby --no-install-recommends && \ - apt-get clean - -RUN gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -RUN curl -sSL https://get.rvm.io | bash -s -ARG RVM_RUBY_VERSION=ruby-head -RUN /bin/bash -l -c "echo $RVM_RUBY_VERSION" -RUN /bin/bash -l -c ". /etc/profile.d/rvm.sh && rvm install $RVM_RUBY_VERSION --binary || rvm install $RVM_RUBY_VERSION" -ADD . /stackprof/ -WORKDIR /stackprof/ -RUN /bin/bash -l -c ". /etc/profile.d/rvm.sh && gem install bundler:1.16.0" -RUN /bin/bash -l -c ". /etc/profile.d/rvm.sh && bundle install" -CMD /bin/bash -l -c ". /etc/profile.d/rvm.sh && bundle exec rake" diff --git a/Rakefile b/Rakefile index 2a2b16e..a5b7222 100644 --- a/Rakefile +++ b/Rakefile @@ -1,31 +1,17 @@ -task :default => :test +require "bundler/gem_tasks" +require "rake/testtask" -# ========================================================== -# Packaging -# ========================================================== - -GEMSPEC = Gem::Specification::load('stackprof.gemspec') - -require 'rubygems/package_task' -Gem::PackageTask.new(GEMSPEC) do |pkg| +Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList["test/**/test_*.rb"] end -# ========================================================== -# Ruby Extension -# ========================================================== +require "rake/extensiontask" -require 'rake/extensiontask' -Rake::ExtensionTask.new('stackprof', GEMSPEC) do |ext| - ext.lib_dir = 'lib/stackprof' +Rake::ExtensionTask.new("stackprof") do |ext| + ext.ext_dir = "ext/stackprof" + ext.lib_dir = "lib/stackprof" end -task :build => :compile -# ========================================================== -# Testing -# ========================================================== - -require 'rake/testtask' -Rake::TestTask.new 'test' do |t| - t.test_files = FileList['test/test_*.rb'] -end -task :test => :build +task default: %i(compile test)