WIP #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| ruby-version: ['3.0', '3.1', '3.2', '3.3'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: false | |
| - name: Configure Bundler | |
| run: | | |
| bundle config set --local frozen false | |
| bundle config set --local deployment false | |
| bundle config set --local path vendor/bundle | |
| - name: Install dependencies | |
| run: | | |
| gem install bundler | |
| bundle install | |
| - name: Run tests | |
| run: | | |
| bundle exec rake test | |
| continue-on-error: true | |
| - name: Build gem | |
| run: | | |
| bundle exec rake build | |
| - name: Verify gem structure | |
| run: | | |
| echo "Looking for gem files..." | |
| ls -la pkg/ || echo "pkg/ directory not found" | |
| ls -la *.gem || echo "No .gem files in current directory" | |
| # Look for gem files in pkg/ directory (default Rake location) | |
| if [ -d "pkg" ]; then | |
| gem_file=$(ls pkg/*.gem | head -1) | |
| if [ -n "$gem_file" ]; then | |
| echo "Found gem in pkg/: $gem_file" | |
| gem specification "$gem_file" | grep -E "(name|version|summary)" | |
| else | |
| echo "No .gem files found in pkg/ directory" | |
| exit 1 | |
| fi | |
| else | |
| # Fallback: look in current directory | |
| gem_file=$(ls *.gem | head -1) | |
| if [ -n "$gem_file" ]; then | |
| echo "Found gem in current directory: $gem_file" | |
| gem specification "$gem_file" | grep -E "(name|version|summary)" | |
| else | |
| echo "No .gem files found anywhere" | |
| exit 1 | |
| fi | |
| fi | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3.6' | |
| bundler-cache: false | |
| - name: Configure Bundler | |
| run: | | |
| bundle config set --local frozen false | |
| bundle config set --local deployment false | |
| bundle config set --local path vendor/bundle | |
| - name: Install dependencies | |
| run: | | |
| gem install bundler | |
| bundle install | |
| - name: Run RuboCop | |
| run: | | |
| if [ -f ".rubocop.yml" ]; then | |
| bundle exec rubocop --parallel | |
| else | |
| echo "No RuboCop configuration found, skipping linting" | |
| fi | |
| continue-on-error: true | |
| - name: Check gem syntax | |
| run: | | |
| echo "Checking Ruby file syntax..." | |
| ruby -c lib/session_recorder/version.rb | |
| ruby -c lib/session_recorder/constants.rb | |
| ruby -c lib/session_recorder/exporters.rb | |
| echo "All Ruby files have valid syntax" | |
| - name: Verify gemspec | |
| run: | | |
| echo "Verifying gemspec..." | |
| ruby -c multiplayer_otlp.gemspec | |
| echo "Gemspec syntax is valid" |