# Copyright © 2025-26 l5yth & contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. name: Ruby on: push: branches: [ "main" ] pull_request: branches: [ "main" ] paths: - '.github/**' - 'web/**' - 'tests/**' permissions: contents: read jobs: sinatra: defaults: run: working-directory: ./web runs-on: ubuntu-latest strategy: # The web image ships Ruby 3.4 (web/Dockerfile); CI tests it and 4.0. # One leg's failure must not cancel the others' results. fail-fast: false matrix: ruby-version: ['3.4', '4.0'] steps: - uses: actions/checkout@v7 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true working-directory: ./web - name: Set up dependencies run: bundle install - name: Run tests run: | mkdir -p tmp/test-results bundle exec rspec \ --require rspec_junit_formatter \ --format progress \ --format RspecJunitFormatter \ --out tmp/test-results/rspec.xml - name: Upload test results to Codecov if: ${{ !cancelled() }} uses: codecov/codecov-action@v7 with: token: ${{ secrets.CODECOV_TOKEN }} report_type: test_results files: ./web/tmp/test-results/rspec.xml flags: sinatra-${{ matrix.ruby-version }} fail_ci_if_error: false - name: Upload coverage to Codecov uses: codecov/codecov-action@v7 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false flags: sinatra-${{ matrix.ruby-version }} env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Run rufo run: bundle exec rufo --check .