name: Ruby on: [push,pull_request] jobs: build: runs-on: ubuntu-latest services: nats: image: nats ports: - 4222 steps: - uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 3.0.2 bundler-cache: true - name: Run the default task env: NATS_PORT: "${{ job.services.nats.ports[4222] }}" NATS_HOST: localhost run: bundle exec rspec