diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 867205b8e4..4391e0b1f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: - name: Run tests run: bundle exec rspec spec/models - test-admin-features: + test-admin-features-1: runs-on: ubuntu-18.04 services: postgres: @@ -90,9 +90,9 @@ jobs: bundle exec rake db:schema:load RAILS_ENV=test - name: Run admin feature tests - run: bundle exec rspec --profile -- spec/features/admin/*_spec.rb + run: bundle exec rspec --profile -- spec/features/admin/[a-o]*_spec.rb - test-admin-features-folders: + test-admin-features-2: runs-on: ubuntu-18.04 services: postgres: @@ -131,7 +131,48 @@ jobs: bundle exec rake db:schema:load RAILS_ENV=test - name: Run admin feature tests - run: bundle exec rspec --profile --pattern "spec/features/admin/*/*_spec.rb" + run: bundle exec rspec --profile -- spec/features/admin/[p-z]*_spec.rb + + test-admin-features-folders-and-controllers: + runs-on: ubuntu-18.04 + services: + postgres: + image: postgres:10 + ports: ["5432:5432"] + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + POSTGRES_DB: open_food_network_test + POSTGRES_USER: ofn + POSTGRES_PASSWORD: f00d + steps: + - uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - uses: actions/setup-node@v2 + with: + node-version: '14.15.5' + + - name: Install JS dependencies + run: yarn install --frozen-lockfile + + - name: Set up application.yml + run: cp config/application.yml.example config/application.yml + + - name: Set up database + run: | + bundle exec rake db:create RAILS_ENV=test + bundle exec rake db:schema:load RAILS_ENV=test + + - name: Run admin feature tests + run: bundle exec rspec --profile --pattern "spec/controllers/{,/*/**}/*_spec.rb,spec/features/admin/*/*_spec.rb" test-consumer-features: runs-on: ubuntu-18.04 @@ -174,47 +215,6 @@ jobs: - name: Run consumer feature tests run: bundle exec rspec --profile -- spec/features/consumer - test-controllers: - runs-on: ubuntu-18.04 - services: - postgres: - image: postgres:10 - ports: ["5432:5432"] - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - env: - POSTGRES_DB: open_food_network_test - POSTGRES_USER: ofn - POSTGRES_PASSWORD: f00d - steps: - - uses: actions/checkout@v2 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - - uses: actions/setup-node@v2 - with: - node-version: '14.15.5' - - - name: Install JS dependencies - run: yarn install --frozen-lockfile - - - name: Set up application.yml - run: cp config/application.yml.example config/application.yml - - - name: Set up database - run: | - bundle exec rake db:create RAILS_ENV=test - bundle exec rake db:schema:load RAILS_ENV=test - - - name: Run tests - run: bundle exec rspec spec/controllers - test-other: runs-on: ubuntu-18.04 services: @@ -257,19 +257,4 @@ jobs: run: RAILS_ENV=test bundle exec rake karma:run - name: Run all other tests - run: | - bundle exec rspec \ - spec/helpers/ \ - spec/initializers/ \ - spec/jobs/ \ - spec/lib/ \ - spec/mailers/ \ - spec/queries/ \ - spec/requests/ \ - spec/serializers/ \ - spec/services/ \ - spec/validators/ \ - spec/views - - - name: Run engines tests - run: bundle exec rake ofn:specs:engines:rspec + run: bundle exec rspec --profile --pattern "engines/*/spec/{,/*/**}/*_spec.rb,spec/{helpers, initializers, jobs, lib, mailers, queries, requests, serializers, services, validators, views}/{,/*/**}/*_spec.rb"