diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 00000000..b48db50c --- /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:15 + 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 +