Merge pull request #7168 from andrewpbrett/rebalance-ci

Rebalance CI jobs
This commit is contained in:
Maikel
2021-03-22 12:23:20 +11:00
committed by GitHub

View File

@@ -10,6 +10,47 @@ env:
TIMEZONE: UTC
jobs:
test-controllers-and-serializers:
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 controller tests
run: bundle exec rspec spec/controllers spec/serializers
test-models:
runs-on: ubuntu-18.04
services:
@@ -51,7 +92,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 +131,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 +172,7 @@ 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-consumer-features:
runs-on: ubuntu-18.04
@@ -174,48 +215,7 @@ 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:
test-engines-etc:
runs-on: ubuntu-18.04
services:
postgres:
@@ -257,19 +257,45 @@ 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
run: bundle exec rspec --profile --pattern "engines/*/spec/{,/*/**}/*_spec.rb,spec/{helpers, initializers, jobs, mailers, queries, requests, services, validators, views}/{,/*/**}/*_spec.rb"
- name: Run engines tests
run: bundle exec rake ofn:specs:engines:rspec
test-the-rest:
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 folders, serializers, jobs, lib
run: bundle exec rspec --profile --pattern "spec/features/admin/*/*_spec.rb,spec/lib/{,/*/**}/*_spec.rb"