Add GitHub Actions to the scale_rb Ruby project
After implementing the initial version of Ruby Digger I found the scale_rb project that had a link to its GitHub repository, but no Continuous Integration configured yet.
I thought this could be a good opportunity to see how is the GitHub Actions configuration file offered by GitHub itself.
I made a few changes to the default file, specifically I have removed some comments and enabled the job an all branches, not only on the main branch of the project.
This was also important as it is usually better to work on a branch before sending a pull-request.
I committed the change to a branch I called CI.
The first run of the GitHub Actions failed for Ruby 3.0 and was cancelled for Ruby 2.6 and 2.7. Then I added fail-fast: false to allow all the jobs to run till completition (or failure).
This allowed me to see that the tests pass on Ruby 2.6 and 2.7.
In the next change I've disabled Ruby 3.0 and sent the pull-request with the following file:
examples/scale_rb_ci.yml
name: Ruby on: push: pull_request: permissions: contents: read jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: ruby-version: ['2.6', '2.7'] # , '3.0' steps: - uses: actions/checkout@v3 - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, # change this to (see https://github.com/ruby/setup-ruby#versioning): # uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3 with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Run tests run: bundle exec rake
Published on 2022-10-13