Skip to content

Commit

Permalink
Ruby 2.2と2.3でCIが失敗するのを修正した
Browse files Browse the repository at this point in the history
ref: [Bump actions/checkout from 3 to 4 · 0a00b89](https://github.com/willnet/gimei/actions/runs/6077952812/job/16528329201?pr=59)

`actions/checkout@4`が必要な環境をruby:2.2やruby:2.3が提供しておらずcheckout時にエラーになってしまっているようだった。コンテナを使い分けるのをやめて、ruby/setup-rubyを使うように変更することで解決する。
  • Loading branch information
willnet committed Sep 6, 2023
1 parent 0a00b89 commit ec01d6e
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,18 @@ jobs:
fail-fast: false

matrix:
ruby:
- ruby:2.2
- ruby:2.3
- ruby:2.4
- ruby:2.5
- ruby:2.6
- ruby:2.7
- ruby:3.0
- ruby:3.1
- ruby:3.2
- rubylang/ruby:master-jammy
ruby-version: ['2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', 'head']
include:
- ruby: rubylang/ruby:master-jammy
allow_failures: "true"
- ruby-version: 'head'
allow_failures: 'true'

steps:
- uses: actions/checkout@v4

- name: Cache vendor/bundle
uses: actions/cache@v3
id: cache_gem
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
path: vendor/bundle
key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
restore-keys: |
v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
continue-on-error: ${{ matrix.allow_failures == 'true' }}

- name: bundle update
run: |
set -xe
bundle config path vendor/bundle
bundle update --jobs $(nproc) --retry 3
continue-on-error: ${{ matrix.allow_failures == 'true' }}
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Run test
run: |
Expand Down

0 comments on commit ec01d6e

Please sign in to comment.