From f5b8eb00bb423e284cf3b9ac52fa87bfe7a05fb8 Mon Sep 17 00:00:00 2001 From: Konstantin Gredeskoul Date: Sat, 17 Feb 2024 12:30:28 -0500 Subject: [PATCH] Adding ruby CI --- .github/workflows/ruby.yml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/ruby.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 00000000..92ee84c4 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,43 @@ +name: RSpec +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:16.2 + ports: + - 5432:5432 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries + redis: + image: redis + ports: + - 6379:6379 + options: --entrypoint redis-server + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2.2 + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - run: | + gem update --system || true + bundle install -j 12 + + - run: | + bin/rails db:create + bin/rails db:migrate + bin/rails db:test:prepare + + - run: | + bundle exec rspec --format documentation +