|
| 1 | +# This workflow uses actions that are not certified by GitHub. |
| 2 | +# They are provided by a third-party and are governed by |
| 3 | +# separate terms of service, privacy policy, and support |
| 4 | +# documentation. |
| 5 | +# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake |
| 6 | +# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby |
| 7 | + |
| 8 | +# |
| 9 | +# Created: 15th August 2026 |
| 10 | +# Updated: 15th August 2026 |
| 11 | +# |
| 12 | + |
| 13 | +name: Ruby |
| 14 | + |
| 15 | +on: |
| 16 | + push: |
| 17 | + branches: |
| 18 | + - master |
| 19 | + - dev |
| 20 | + - boilerplate |
| 21 | + - idiomatic |
| 22 | + - rc1 |
| 23 | + - rc2 |
| 24 | + - rc3 |
| 25 | + pull_request: |
| 26 | + |
| 27 | +permissions: |
| 28 | + contents: read |
| 29 | + |
| 30 | +defaults: |
| 31 | + run: |
| 32 | + shell: bash |
| 33 | + |
| 34 | +jobs: |
| 35 | + test: |
| 36 | + |
| 37 | + strategy: |
| 38 | + fail-fast: false |
| 39 | + |
| 40 | + matrix: |
| 41 | + os: |
| 42 | + - macos-latest |
| 43 | + - ubuntu-latest |
| 44 | + - windows-latest |
| 45 | + |
| 46 | + ruby-version: |
| 47 | + # - head |
| 48 | + - '3.4' |
| 49 | + - '3.3' |
| 50 | + - '3.2' |
| 51 | + - '3.1' |
| 52 | + - '3.0' |
| 53 | + - '2.7' |
| 54 | + - '2.6' |
| 55 | + |
| 56 | + include: |
| 57 | + - os: ubuntu-latest |
| 58 | + ruby-version: '2.5' |
| 59 | + - os: ubuntu-latest |
| 60 | + ruby-version: '2.4' |
| 61 | + - os: ubuntu-latest |
| 62 | + ruby-version: '2.0' |
| 63 | + - os: windows-latest |
| 64 | + ruby-version: mingw |
| 65 | + |
| 66 | + runs-on: ${{ matrix.os }} |
| 67 | + |
| 68 | + steps: |
| 69 | + - name: Checking out code |
| 70 | + uses: actions/checkout@v4 |
| 71 | + |
| 72 | + - name: Remove Gemfile.lock |
| 73 | + run: rm -f Gemfile.lock |
| 74 | + |
| 75 | + - name: Set up Ruby v${{ matrix.ruby-version }} |
| 76 | + uses: ruby/setup-ruby@v1 |
| 77 | + with: |
| 78 | + ruby-version: ${{ matrix.ruby-version }} |
| 79 | + bundler-cache: true # runs 'bundle install' and caches installed gems automatically |
| 80 | + |
| 81 | + - name: Show Ruby version |
| 82 | + run: ruby -v |
| 83 | + |
| 84 | + - name: Run tests |
| 85 | + run: bundle exec rake test |
| 86 | + |
| 87 | + - name: Gem build and install smoke |
| 88 | + shell: bash |
| 89 | + run: | |
| 90 | + gem build libpath.gemspec |
| 91 | + gem install --local libpath-ruby-*.gem |
| 92 | + ruby -e "require 'libpath/version'; abort('VERSION missing') unless defined?(LibPath::VERSION); puts LibPath::VERSION" |
| 93 | +
|
| 94 | + warnings: |
| 95 | + |
| 96 | + name: Warnings |
| 97 | + |
| 98 | + runs-on: ubuntu-latest |
| 99 | + |
| 100 | + steps: |
| 101 | + - name: Checking out code |
| 102 | + uses: actions/checkout@v4 |
| 103 | + |
| 104 | + - name: Remove Gemfile.lock |
| 105 | + run: rm -f Gemfile.lock |
| 106 | + |
| 107 | + - name: Set up Ruby |
| 108 | + uses: ruby/setup-ruby@v1 |
| 109 | + with: |
| 110 | + ruby-version: '3.3' |
| 111 | + bundler-cache: true |
| 112 | + |
| 113 | + - name: Show Ruby version |
| 114 | + run: ruby -v |
| 115 | + |
| 116 | + - name: Run unit tests with warnings |
| 117 | + run: ./run_all_unit_tests.sh --lib --warnings |
0 commit comments