From 5cbd37f1128f34f42224b61a164515a1806f2bbb Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Fri, 19 Mar 2021 11:17:11 -0700 Subject: [PATCH] reorder jobs and move to 7 jobs --- .github/workflows/build.yml | 127 ++++++++++++++++++++++++------------ 1 file changed, 84 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4391e0b1f9..17d7351406 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -133,47 +174,6 @@ jobs: - name: Run admin feature tests 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 services: @@ -215,7 +215,7 @@ jobs: - name: Run consumer feature tests run: bundle exec rspec --profile -- spec/features/consumer - test-other: + test-engines-etc: runs-on: ubuntu-18.04 services: postgres: @@ -257,4 +257,45 @@ jobs: run: RAILS_ENV=test bundle exec rake karma:run - name: Run all other tests - run: bundle exec rspec --profile --pattern "engines/*/spec/{,/*/**}/*_spec.rb,spec/{helpers, initializers, jobs, lib, mailers, queries, requests, serializers, services, validators, views}/{,/*/**}/*_spec.rb" + run: bundle exec rspec --profile --pattern "engines/*/spec/{,/*/**}/*_spec.rb,spec/{helpers, initializers, jobs, mailers, queries, requests, services, validators, views}/{,/*/**}/*_spec.rb" + + 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"