Closed lef237 closed 1 year ago
RSpecのCI設定については、別のファイルに分ける。
Run bin/rails db:schema:load
/home/runner/work/quotelist/quotelist/db/schema.rb doesn't exist yet. Run `bin/rails db:migrate` to create it, then try again. If you do not intend to use a database, you should instead alter /home/runner/work/quotelist/quotelist/config/application.rb to limit the frameworks that will be loaded.
というエラーが出たため、schema.rb
を作成してから設定してみる。
また、テストのCIに関しては、
# JSのビルド
yarn build
# CSSのビルド
yarn build:css
をGitHub Actionsのファイルでおこなう必要がありそう。
※bin/dev
はyarn build
とyarn build:css
を随時行ってくれる機能
Specifying the Ruby version | Building and testing Ruby - GitHub Docs
- uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
つまり、.ruby-version
のファイルがあるときは、Rubyのバージョンを指定してあげなくても大丈夫。
https://github.com/lef237/quotelist/actions/new
ここからテンプレートを選んで、それを元に改変していくと簡単にCIを構築できる。
今回は
Ruby on Rails
を選択して、そこに改変を加えた。