Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Oct 10, 2024
1 parent 3001bf3 commit 2274cdf
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 27 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.1', '3.2', '3.3', 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
10 changes: 5 additions & 5 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
chichilku3 (15.0.2)
chichilku3 (15.0.3)
fileutils (~> 1.6.0)
gosu (~> 1.4.3)
os (~> 1.0.1)
Expand All @@ -11,9 +11,9 @@ PATH
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.5.0)
diff-lcs (1.5.1)
fileutils (1.6.0)
gosu (1.4.3)
gosu (1.4.6)
os (1.0.1)
rspec (3.9.0)
rspec-core (~> 3.9.0)
Expand All @@ -31,6 +31,10 @@ GEM
rubyzip (2.3.2)

PLATFORMS
arm64-darwin-22
arm64-darwin-23
universal-java-11
universal-java-21
x86_64-linux

DEPENDENCIES
Expand Down
6 changes: 2 additions & 4 deletions chichilku3.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'rake'

Gem::Specification.new do |s|
s.name = 'chichilku3'
s.version = '15.0.3'
Expand All @@ -13,7 +11,7 @@ Gem::Specification.new do |s|
DESC
s.authors = ['ChillerDragon']
s.email = '[email protected]'
s.files = FileList[
s.files = [
'lib/client/*.rb',
'lib/server/*.rb',
'lib/share/*.rb',
Expand All @@ -28,7 +26,7 @@ Gem::Specification.new do |s|
'client.json',
'server.json',
'maps'
]
].map { |glob| Dir[glob] }.flatten
s.required_ruby_version = '>= 3.1.2'
s.add_dependency 'fileutils', '~> 1.6.0'
s.add_dependency 'gosu', '~> 1.4.3'
Expand Down
2 changes: 1 addition & 1 deletion lib/client/gui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def frame_time
# Main Game getting gui form gosu
class Gui < Gosu::Window
def initialize(cfg)
super WINDOW_SIZE_X, WINDOW_SIZE_Y
super(WINDOW_SIZE_X, WINDOW_SIZE_Y)
self.caption = 'chichilku3'
self.fullscreen = true if cfg.data['fullscreen']
# images
Expand Down
2 changes: 1 addition & 1 deletion lib/share/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def net_pack_bigint(int, size)
(size - 1).times do
buf = int / ((NET_MAX_INT + 1)**div)
sum += net_pack_int(buf)
int = int % ((NET_MAX_INT + 1)**div)
int %= ((NET_MAX_INT + 1)**div)
div -= 1
end
sum += net_pack_int(int)
Expand Down

0 comments on commit 2274cdf

Please sign in to comment.