|
1 | | -name: Ruby |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | - push |
5 | 5 | - pull_request |
6 | 6 |
|
| 7 | +permissions: |
| 8 | + contents: read # checkout only, nothing else |
| 9 | + |
7 | 10 | jobs: |
| 11 | + audit: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 15 | + with: |
| 16 | + persist-credentials: false |
| 17 | + - uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0 |
| 18 | + with: |
| 19 | + ruby-version: "3.4" |
| 20 | + bundler-cache: true |
| 21 | + - name: Audit dependencies |
| 22 | + run: bundle exec bundle-audit check --update |
| 23 | + - name: Audit Ruby runtime |
| 24 | + # CVE-2026-41316 is an ERB flaw fixed in Ruby 4.0.3 and not yet backported. |
| 25 | + # Ignored on affected rubies only. See: |
| 26 | + # https://www.ruby-lang.org/en/news/2026/04/21/erb-cve-2026-41316/ |
| 27 | + # https://github.com/advisories/GHSA-q339-8rmv-2mhv |
| 28 | + run: | |
| 29 | + ignore="" |
| 30 | + if ruby -e 'exit 1 unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new("4.0.3")'; then |
| 31 | + ignore="--ignore CVE-2026-41316" |
| 32 | + fi |
| 33 | + bundle exec ruby-audit check $ignore |
| 34 | +
|
| 35 | + zizmor: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 39 | + with: |
| 40 | + persist-credentials: false |
| 41 | + - name: Audit workflows |
| 42 | + uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7 |
| 43 | + with: |
| 44 | + advanced-security: false # fail the build on findings instead of uploading SARIF |
| 45 | + |
| 46 | + lint: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 50 | + with: |
| 51 | + persist-credentials: false |
| 52 | + - uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0 |
| 53 | + with: |
| 54 | + ruby-version: "3.4" |
| 55 | + bundler-cache: true |
| 56 | + - name: Standard |
| 57 | + run: bundle exec standardrb |
| 58 | + |
8 | 59 | test: |
9 | 60 | runs-on: ubuntu-latest |
10 | 61 | strategy: |
11 | 62 | fail-fast: false |
12 | 63 | matrix: |
13 | | - ruby: [3.0, 3.1, 3.2, 3.3, head, truffleruby-head] |
14 | | - env: |
15 | | - RAILS_ENV: test |
| 64 | + ruby: ['3.0', 3.1, 3.2, 3.3, 3.4, '4.0', truffleruby, head, truffleruby-head, jruby-9.4.8] |
| 65 | + # Head builds surface upstream regressions early and should not block. |
| 66 | + # jruby is included provisionally: akami's OpenSSL-based signing and GOST |
| 67 | + # engine make its jruby support unverified, so it does not block either |
| 68 | + # until a green run proves it can be promoted to a required build. |
| 69 | + continue-on-error: ${{ matrix.ruby == 'head' || matrix.ruby == 'truffleruby-head' || matrix.ruby == 'jruby-9.4.8' }} |
16 | 70 | steps: |
17 | | - - uses: actions/checkout@v4 |
| 71 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 72 | + with: |
| 73 | + persist-credentials: false |
18 | 74 | - name: Set up Ruby |
19 | | - uses: ruby/setup-ruby@v1 |
| 75 | + uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0 |
20 | 76 | with: |
21 | 77 | ruby-version: ${{ matrix.ruby }} |
22 | 78 | bundler-cache: true # bundle installs and caches dependencies |
23 | 79 | - name: Run tests |
24 | 80 | run: bundle exec rake --trace |
| 81 | + - name: Upload coverage to Coveralls |
| 82 | + if: matrix.ruby == '3.4' |
| 83 | + uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7 |
| 84 | + with: |
| 85 | + file: coverage/.resultset.json |
| 86 | + format: simplecov |
0 commit comments