WIP #1
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: true | |
| - 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: | | |
| gem_file=$(ls *.gem | head -1) | |
| if [ -n "$gem_file" ]; then | |
| echo "Built gem: $gem_file" | |
| gem specification "$gem_file" | grep -E "(name|version|summary)" | |
| else | |
| echo "No gem file found" | |
| exit 1 | |
| 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: true | |
| - name: Install dependencies | |
| run: | | |
| gem install bundler | |
| bundle install | |
| - name: Run RuboCop (if configured) | |
| run: | | |
| if [ -f ".rubocop.yml" ]; then | |
| bundle exec rubocop | |
| else | |
| echo "No RuboCop configuration found, skipping linting" | |
| fi | |
| continue-on-error: true | |
| - name: Check gem syntax | |
| run: | | |
| 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" |