name: ubuntu-lint

on:
  pull_request:

  push:
    branches:
      - 3.5

concurrency:
  group: ci-${{ github.ref }}-${{ github.workflow }}
  cancel-in-progress: true

permissions: # added using https://github.com/step-security/secure-workflows
  contents: read

jobs:
  ubuntu_lint:
    name: Lint on ${{ matrix.ruby.name }}
    runs-on: ubuntu-24.04
    strategy:
      fail-fast: false
      matrix:
        ruby:
          - { name: ruby, value: 3.3.5 }
          - { name: truffleruby, value: truffleruby-24.0.1 }
    env:
      RUBYOPT: -Ilib
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - name: Setup ruby
        uses: ruby/setup-ruby@7d3497fd78c07c0d84ebafa58d8dac60cd1f0763 # v1.199.0
        with:
          ruby-version: ${{ matrix.ruby.value }}
          bundler: none
      - name: Install Dependencies
        run: bin/rake setup
      - name: Run Lint
        run: bin/rake rubocop
      - name: Generate docs
        run: bin/rake docs
      - name: Install & Check Dependencies
        run: bin/rake dev:frozen_deps
      - name: Misc checks
        run: bin/rake check_rvm_integration man:check vendor:check version:check check_rubygems_integration
    timeout-minutes: 15
