From 51af60afa6c8b98ca7438847f6fb5f0703deb869 Mon Sep 17 00:00:00 2001 From: Matt Larraz Date: Tue, 10 Jan 2023 12:29:16 -0500 Subject: [PATCH] Move CI to Github Actions --- .github/workflows/CI.yml | 37 +++++++++++++++++++++++++++++++++++++ Rakefile | 6 +++--- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..ef5754c --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,37 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + ruby: + - '2.5' + - '2.6' + - '2.7' + - '3.0' + - '3.1' + - '3.2' + - head + os: + - "ubuntu-22.04" + - "ubuntu-20.04" + - "macos-12" + - "macos-11" + continue-on-error: ${{ matrix.ruby == 'head' }} + name: Ruby ${{ matrix.ruby }} / ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: | + bundle exec rake diff --git a/Rakefile b/Rakefile index abe2fe3..f973ed3 100644 --- a/Rakefile +++ b/Rakefile @@ -54,7 +54,7 @@ end desc "Remove built files" task :clean do cd "ext" do - if File.exists?("Makefile") + if File.exist?("Makefile") sh "make clean" rm "Makefile" end @@ -62,14 +62,14 @@ task :clean do rm derived_files unless derived_files.empty? end cd "ext/attach" do - if File.exists?("Makefile") + if File.exist?("Makefile") sh "make clean" rm "Makefile" end derived_files = Dir.glob(".o") + Dir.glob("*.so") + Dir.glob("*.bundle") rm derived_files unless derived_files.empty? end - if File.exists?('pkg') + if File.exist?('pkg') cd 'pkg' do derived_files = Dir.glob('*.gem') rm derived_files unless derived_files.empty?