From bd53865b538014b2fa9eef1f70431a63abec2ddb Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Thu, 10 Oct 2024 11:50:33 +0900 Subject: [PATCH] Update CI --- .github/workflows/ruby.yml | 35 +++++++++++++++++++++++++---------- .github/workflows/style.yml | 10 +++++----- .github/workflows/test.yml | 6 +++--- chichilku3.gemspec | 6 ++---- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index b952de4..4940ca7 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -8,19 +8,34 @@ on: jobs: run-tests: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' + ruby: ['3.0', '3.1', '3.2', '3.3', head, jruby, jruby-head, truffleruby, truffleruby-head] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 - runs-on: ubuntu-latest + - name: Prepare Linux + if: contains(matrix.os, 'ubuntu') + run: | + sudo apt-get update -y + sudo apt-get install git libfontconfig1-dev libsndfile1-dev libsdl2-dev libmpg123-dev libopenal1 libopenal-dev - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby 3.1 - uses: actions/setup-ruby@v1 + - name: Prepare macOS + if: contains(matrix.os, 'macOS') + run: | + brew update || true + brew install pkg-config sdl2 || true + sudo rm -rf /Library/Developer/CommandLineTools + + - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.1.x + ruby-version: ${{ matrix.ruby }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Build and test with rspec run: | - sudo apt-get update - sudo apt-get install git libfontconfig1-dev libsndfile1-dev libsdl2-dev libmpg123-dev libopenal1 libopenal-dev - gem install bundler - bundle install --jobs 4 --retry 3 bundle exec rspec diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 09adedc..7984ff6 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -12,17 +12,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Ruby 3.1 - uses: actions/setup-ruby@v1 + - uses: actions/checkout@v4 + - name: Set up Ruby 3.3.5 + uses: ruby/setup-ruby@v1 with: - ruby-version: 3.1.x + ruby-version: '3.3.5' - name: Prepare run: | sudo apt-get update sudo apt-get install git libfontconfig1-dev libsndfile1-dev libsdl2-dev libmpg123-dev libopenal1 libopenal-dev shellcheck gem install bundler - gem install rubocop:1.31.2 + gem install rubocop:1.66.1 bundle install --jobs 4 --retry 3 - name: Check ruby with rubocop run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c92c2f..a286e4a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,11 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Ruby 3.1 + - uses: actions/checkout@v4 + - name: Set up Ruby 3.3 uses: actions/setup-ruby@v1 with: - ruby-version: 3.1.x + ruby-version: 3.3.x - name: Prepare run: | sudo apt-get update diff --git a/chichilku3.gemspec b/chichilku3.gemspec index 6a0da28..78b976d 100644 --- a/chichilku3.gemspec +++ b/chichilku3.gemspec @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'rake' - Gem::Specification.new do |s| s.name = 'chichilku3' s.version = '15.0.3' @@ -13,7 +11,7 @@ Gem::Specification.new do |s| DESC s.authors = ['ChillerDragon'] s.email = 'ChillerDragon@gmail.com' - s.files = FileList[ + s.files = [ 'lib/client/*.rb', 'lib/server/*.rb', 'lib/share/*.rb', @@ -28,7 +26,7 @@ Gem::Specification.new do |s| 'client.json', 'server.json', 'maps' - ] + ].map { |glob| Dir[glob] }.flatten s.required_ruby_version = '>= 3.3.5' s.add_dependency 'fileutils', '~> 1.6.0' s.add_dependency 'gosu', '~> 1.4.3'