Minor updates #10
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: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby ${{ matrix.ruby-version }} | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: true | |
| - name: Install dependencies | |
| run: bundle install | |
| - name: Run tests | |
| run: bundle exec rake test || true | |
| continue-on-error: true | |
| - name: Run RuboCop | |
| run: bundle exec rubocop || true | |
| continue-on-error: true | |
| publish: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Publish to RubyGems | |
| run: | | |
| mkdir -p $HOME/.gem | |
| echo "---" > $HOME/.gem/credentials | |
| echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" >> $HOME/.gem/credentials | |
| chmod 600 $HOME/.gem/credentials | |
| gem build *.gemspec | |
| gem push *.gem | |