From 10d1d2066e80bb7a915f96181f8685bd12dded7f Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 21 Nov 2022 10:12:49 +0000 Subject: [PATCH] Merges separate knapsack_pro build files into one Renames jobs Includes jest and karma tests in build file Renames jest karma job Moves build setup into build.yml file Changes job names Re-distributes nodes according to run-time --- .github/workflows/build.yml | 372 +++++++++++++++++- .github/workflows/build_engines.yml | 97 ----- .../workflows/build_knapsack_controllers.yml | 89 ----- .github/workflows/build_knapsack_models.yml | 89 ----- .github/workflows/build_knapsack_system.yml | 97 ----- .../build_knapsack_test_the_rest.yml | 90 ----- 6 files changed, 366 insertions(+), 468 deletions(-) delete mode 100644 .github/workflows/build_engines.yml delete mode 100644 .github/workflows/build_knapsack_controllers.yml delete mode 100644 .github/workflows/build_knapsack_models.yml delete mode 100644 .github/workflows/build_knapsack_system.yml delete mode 100644 .github/workflows/build_knapsack_test_the_rest.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0bc8b5551c..07a8c328cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: jest and karma (non-Knapsack) +name: Build on: workflow_dispatch: @@ -8,7 +8,6 @@ on: pull_request: env: - DISABLE_KNAPSACK: true DISABLE_KNAPSACK_PRO: false TIMEZONE: UTC COVERAGE: true @@ -18,7 +17,371 @@ permissions: contents: read jobs: - test-the-rest: + knapsack_rspec_controllers: + runs-on: ubuntu-20.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 + strategy: + fail-fast: false + matrix: + # [n] - where the n is a number of parallel jobs you want to run your tests on. + # Use a higher number if you have slow tests to split them between more parallel jobs. + # Remember to update the value of the `ci_node_index` below to (0..n-1). + ci_node_total: [8] + # Indexes for parallel jobs (starting from zero). + # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. + ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7] + steps: + - uses: actions/checkout@v3 + + - name: Setup redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + + - 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@v3 + with: + node-version: 16 + + - name: Install JS dependencies + run: yarn install --frozen-lockfile + + - name: Set up database + run: | + bundle exec rake db:create + bundle exec rake db:schema:load + + - name: Run tests + + env: + KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 864ef557d85ea8e603e086c0387d5154 + KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_PRO_LOG_LEVEL: info + # if you use Knapsack Pro Queue Mode you must set below env variable + # to be able to retry CI build and run previously recorded tests + # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node + # KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false + # RSpec split test files by test examples feature - it's optional + # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it + #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true + KNAPSACK_PRO_TEST_FILE_PATTERN: "spec/controllers/**/*_spec.rb" + + run: | + bundle exec rake knapsack_pro:rspec + + knapsack_rspec_models: + runs-on: ubuntu-20.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 + strategy: + fail-fast: false + matrix: + # [n] - where the n is a number of parallel jobs you want to run your tests on. + # Use a higher number if you have slow tests to split them between more parallel jobs. + # Remember to update the value of the `ci_node_index` below to (0..n-1). + ci_node_total: [7] + # Indexes for parallel jobs (starting from zero). + # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. + ci_node_index: [0, 1, 2, 3, 4, 5, 6] + steps: + - uses: actions/checkout@v3 + + - name: Setup redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + + - 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@v3 + with: + node-version: 16 + + - name: Install JS dependencies + run: yarn install --frozen-lockfile + + - name: Set up database + run: | + bundle exec rake db:create + bundle exec rake db:schema:load + + - name: Run tests + + env: + KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 09476e2ce491c12083df62768667c674 + KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_PRO_LOG_LEVEL: info + # if you use Knapsack Pro Queue Mode you must set below env variable + # to be able to retry CI build and run previously recorded tests + # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node + # KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false + # RSpec split test files by test examples feature - it's optional + # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it + #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true + KNAPSACK_PRO_TEST_FILE_PATTERN: "spec/models/**/*_spec.rb" + + run: | + bundle exec rake knapsack_pro:rspec + + knapsack_rspec_system: + runs-on: ubuntu-20.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 + strategy: + fail-fast: false + matrix: + # [n] - where the n is a number of parallel jobs you want to run your tests on. + # Use a higher number if you have slow tests to split them between more parallel jobs. + # Remember to update the value of the `ci_node_index` below to (0..n-1). + ci_node_total: [30] + # Indexes for parallel jobs (starting from zero). + # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. + ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29] + steps: + - uses: actions/checkout@v3 + + - name: Setup redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + + - 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@v3 + with: + node-version: 16 + + - name: Install JS dependencies + run: yarn install --frozen-lockfile + + - name: Set up database + run: | + bundle exec rake db:create + bundle exec rake db:schema:load + + - name: Run tests + + env: + KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: ff2456e64c9f2aa5157eb0daf711d3c3 + KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_PRO_LOG_LEVEL: info + # if you use Knapsack Pro Queue Mode you must set below env variable + # to be able to retry CI build and run previously recorded tests + # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node + KNAPSACK_PRO_FIXED_QUEUE_SPLIT: true + # RSpec split test files by test examples feature - it's optional + # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it + #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true + KNAPSACK_PRO_TEST_FILE_PATTERN: "spec/system/**/*_spec.rb" + + run: | + bundle exec rake knapsack_pro:queue:rspec + + - name: Archive failed tests screenshots + if: failure() + uses: actions/upload-artifact@v3 + with: + name: failed-tests-screenshots + path: tmp/capybara/screenshots/*.png + retention-days: 7 + if-no-files-found: ignore + + knapsack_rspec_engines: + runs-on: ubuntu-20.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 + strategy: + fail-fast: false + matrix: + # [n] - where the n is a number of parallel jobs you want to run your tests on. + # Use a higher number if you have slow tests to split them between more parallel jobs. + # Remember to update the value of the `ci_node_index` below to (0..n-1). + ci_node_total: [5] + # Indexes for parallel jobs (starting from zero). + # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. + ci_node_index: [0, 1, 2, 3, 4] + steps: + - uses: actions/checkout@v3 + + - name: Setup redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + + - 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@v3 + with: + node-version: 16 + + - name: Install JS dependencies + run: yarn install --frozen-lockfile + + - name: Set up database + run: | + bundle exec rake db:create + bundle exec rake db:schema:load + + - name: Run tests + + env: + KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 09476e2ce491c12083df62768667c674 + KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_PRO_LOG_LEVEL: info + # if you use Knapsack Pro Queue Mode you must set below env variable + # to be able to retry CI build and run previously recorded tests + # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node + # KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false + # RSpec split test files by test examples feature - it's optional + # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it + #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true + KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/lib/**/*_spec.rb, spec/migrations/**/*_spec.rb, spec/serializers/**/*_spec.rb, engines/**/*_spec.rb}" + + run: | + bundle exec rake knapsack_pro:rspec + + - name: Archive failed tests screenshots + if: failure() + uses: actions/upload-artifact@v3 + with: + name: failed-tests-screenshots + path: tmp/capybara/screenshots/*.png + retention-days: 7 + if-no-files-found: ignore + + knapsack_rspec_test_the_rest: + runs-on: ubuntu-20.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 + strategy: + fail-fast: false + matrix: + # [n] - where the n is a number of parallel jobs you want to run your tests on. + # Use a higher number if you have slow tests to split them between more parallel jobs. + # Remember to update the value of the `ci_node_index` below to (0..n-1). + ci_node_total: [5] + # Indexes for parallel jobs (starting from zero). + # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. + ci_node_index: [0, 1, 2, 3, 4] + steps: + - uses: actions/checkout@v3 + + - name: Setup redis + uses: supercharge/redis-github-action@1.4.0 + with: + redis-version: 6 + + - 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@v3 + with: + node-version: 16 + + - name: Install JS dependencies + run: yarn install --frozen-lockfile + + - name: Set up database + run: | + bundle exec rake db:create + bundle exec rake db:schema:load + + - name: Run tests + + env: + KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: e3b8800198d2d89b70c7edbdd85f8fd8 + KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_PRO_LOG_LEVEL: info + # if you use Knapsack Pro Queue Mode you must set below env variable + # to be able to retry CI build and run previously recorded tests + # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node + # KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false + # RSpec split test files by test examples feature - it's optional + # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it + #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true + KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN: "{engines/**{,/*/**}/*_spec.rb,spec/models/**{,/*/**}/*_spec.rb,spec/controllers/**{,/*/**}/*_spec.rb,spec/serializers/**{,/*/**}/*_spec.rb,spec/lib/**{,/*/**}/*_spec.rb,spec/migrations/**{,/*/**}/*_spec.rb,spec/system/**{,/*/**}/*_spec.rb}" + + + run: | + bundle exec rake knapsack_pro:rspec + + non_knapsack_jest_karma: runs-on: ubuntu-20.04 services: postgres: @@ -62,6 +425,3 @@ jobs: - name: Run jest tests run: yarn jest - - - name: Run all other tests - run: bundle exec rspec --exclude-pattern "./models/**/*_spec.rb, ./controllers/**/*_spec.rb, ./serializers/**/*_spec.rb, ./lib/**/*_spec.rb, ./migrations/**/*_spec.rb, ./system/**/*_spec.rb" diff --git a/.github/workflows/build_engines.yml b/.github/workflows/build_engines.yml deleted file mode 100644 index 50866db697..0000000000 --- a/.github/workflows/build_engines.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Build Knapsack Engines - -on: - workflow_dispatch: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - -env: - DISABLE_KNAPSACK: true - DISABLE_KNAPSACK_PRO: false - TIMEZONE: UTC - COVERAGE: true - RAILS_ENV: test - -permissions: - contents: read - -jobs: - rspec: - runs-on: ubuntu-20.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 - strategy: - fail-fast: false - matrix: - # [n] - where the n is a number of parallel jobs you want to run your tests on. - # Use a higher number if you have slow tests to split them between more parallel jobs. - # Remember to update the value of the `ci_node_index` below to (0..n-1). - ci_node_total: [10] - # Indexes for parallel jobs (starting from zero). - # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. - ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - steps: - - uses: actions/checkout@v3 - - - name: Setup redis - uses: supercharge/redis-github-action@1.4.0 - with: - redis-version: 6 - - - 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@v3 - with: - node-version: 16 - - - name: Install JS dependencies - run: yarn install --frozen-lockfile - - - name: Set up database - run: | - bundle exec rake db:create - bundle exec rake db:schema:load - - - name: Run tests - - env: - KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 09476e2ce491c12083df62768667c674 - KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_PRO_LOG_LEVEL: info - # if you use Knapsack Pro Queue Mode you must set below env variable - # to be able to retry CI build and run previously recorded tests - # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node - # KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false - # RSpec split test files by test examples feature - it's optional - # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it - #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true - KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/lib/**/*_spec.rb, spec/migrations/**/*_spec.rb, spec/serializers/**/*_spec.rb, engines/**/*_spec.rb}" - - run: | - bundle exec rake knapsack_pro:rspec - - - name: Archive failed tests screenshots - if: failure() - uses: actions/upload-artifact@v3 - with: - name: failed-tests-screenshots - path: tmp/capybara/screenshots/*.png - retention-days: 7 - if-no-files-found: ignore diff --git a/.github/workflows/build_knapsack_controllers.yml b/.github/workflows/build_knapsack_controllers.yml deleted file mode 100644 index bd840410f9..0000000000 --- a/.github/workflows/build_knapsack_controllers.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Build KnapSack Controllers - -on: - workflow_dispatch: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - -env: - DISABLE_KNAPSACK: true - DISABLE_KNAPSACK_PRO: false - TIMEZONE: UTC - COVERAGE: true - RAILS_ENV: test - -permissions: - contents: read - -jobs: - rspec: - runs-on: ubuntu-20.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 - strategy: - fail-fast: false - matrix: - # [n] - where the n is a number of parallel jobs you want to run your tests on. - # Use a higher number if you have slow tests to split them between more parallel jobs. - # Remember to update the value of the `ci_node_index` below to (0..n-1). - ci_node_total: [5] - # Indexes for parallel jobs (starting from zero). - # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. - ci_node_index: [0, 1, 2, 3, 4] - steps: - - uses: actions/checkout@v3 - - - name: Setup redis - uses: supercharge/redis-github-action@1.4.0 - with: - redis-version: 6 - - - 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@v3 - with: - node-version: 16 - - - name: Install JS dependencies - run: yarn install --frozen-lockfile - - - name: Set up database - run: | - bundle exec rake db:create - bundle exec rake db:schema:load - - - name: Run tests - - env: - KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 864ef557d85ea8e603e086c0387d5154 - KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_PRO_LOG_LEVEL: info - # if you use Knapsack Pro Queue Mode you must set below env variable - # to be able to retry CI build and run previously recorded tests - # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node - # KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false - # RSpec split test files by test examples feature - it's optional - # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it - #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true - KNAPSACK_PRO_TEST_FILE_PATTERN: "spec/controllers/**/*_spec.rb" - - run: | - bundle exec rake knapsack_pro:rspec - diff --git a/.github/workflows/build_knapsack_models.yml b/.github/workflows/build_knapsack_models.yml deleted file mode 100644 index d3bea5daa1..0000000000 --- a/.github/workflows/build_knapsack_models.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Build KnapSack Models - -on: - workflow_dispatch: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - -env: - DISABLE_KNAPSACK: true - DISABLE_KNAPSACK_PRO: false - TIMEZONE: UTC - COVERAGE: true - RAILS_ENV: test - -permissions: - contents: read - -jobs: - rspec: - runs-on: ubuntu-20.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 - strategy: - fail-fast: false - matrix: - # [n] - where the n is a number of parallel jobs you want to run your tests on. - # Use a higher number if you have slow tests to split them between more parallel jobs. - # Remember to update the value of the `ci_node_index` below to (0..n-1). - ci_node_total: [5] - # Indexes for parallel jobs (starting from zero). - # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. - ci_node_index: [0, 1, 2, 3, 4] - steps: - - uses: actions/checkout@v3 - - - name: Setup redis - uses: supercharge/redis-github-action@1.4.0 - with: - redis-version: 6 - - - 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@v3 - with: - node-version: 16 - - - name: Install JS dependencies - run: yarn install --frozen-lockfile - - - name: Set up database - run: | - bundle exec rake db:create - bundle exec rake db:schema:load - - - name: Run tests - - env: - KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 09476e2ce491c12083df62768667c674 - KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_PRO_LOG_LEVEL: info - # if you use Knapsack Pro Queue Mode you must set below env variable - # to be able to retry CI build and run previously recorded tests - # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node - # KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false - # RSpec split test files by test examples feature - it's optional - # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it - #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true - KNAPSACK_PRO_TEST_FILE_PATTERN: "spec/models/**/*_spec.rb" - - run: | - bundle exec rake knapsack_pro:rspec - diff --git a/.github/workflows/build_knapsack_system.yml b/.github/workflows/build_knapsack_system.yml deleted file mode 100644 index 44ac1496b2..0000000000 --- a/.github/workflows/build_knapsack_system.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Build Knapsack System - -on: - workflow_dispatch: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - -env: - DISABLE_KNAPSACK: true - DISABLE_KNAPSACK_PRO: false - TIMEZONE: UTC - COVERAGE: true - RAILS_ENV: test - -permissions: - contents: read - -jobs: - rspec: - runs-on: ubuntu-20.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 - strategy: - fail-fast: false - matrix: - # [n] - where the n is a number of parallel jobs you want to run your tests on. - # Use a higher number if you have slow tests to split them between more parallel jobs. - # Remember to update the value of the `ci_node_index` below to (0..n-1). - ci_node_total: [24] - # Indexes for parallel jobs (starting from zero). - # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. - ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23] - steps: - - uses: actions/checkout@v3 - - - name: Setup redis - uses: supercharge/redis-github-action@1.4.0 - with: - redis-version: 6 - - - 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@v3 - with: - node-version: 16 - - - name: Install JS dependencies - run: yarn install --frozen-lockfile - - - name: Set up database - run: | - bundle exec rake db:create - bundle exec rake db:schema:load - - - name: Run tests - - env: - KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: ff2456e64c9f2aa5157eb0daf711d3c3 - KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_PRO_LOG_LEVEL: info - # if you use Knapsack Pro Queue Mode you must set below env variable - # to be able to retry CI build and run previously recorded tests - # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node - KNAPSACK_PRO_FIXED_QUEUE_SPLIT: true - # RSpec split test files by test examples feature - it's optional - # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it - #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true - KNAPSACK_PRO_TEST_FILE_PATTERN: "spec/system/**/*_spec.rb" - - run: | - bundle exec rake knapsack_pro:queue:rspec - - - name: Archive failed tests screenshots - if: failure() - uses: actions/upload-artifact@v3 - with: - name: failed-tests-screenshots - path: tmp/capybara/screenshots/*.png - retention-days: 7 - if-no-files-found: ignore diff --git a/.github/workflows/build_knapsack_test_the_rest.yml b/.github/workflows/build_knapsack_test_the_rest.yml deleted file mode 100644 index 3cb7fe1f1e..0000000000 --- a/.github/workflows/build_knapsack_test_the_rest.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Build Knapsack test-the-rest - -on: - workflow_dispatch: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - -env: - DISABLE_KNAPSACK: true - DISABLE_KNAPSACK_PRO: false - TIMEZONE: UTC - COVERAGE: true - RAILS_ENV: test - -permissions: - contents: read - -jobs: - rspec: - runs-on: ubuntu-20.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 - strategy: - fail-fast: false - matrix: - # [n] - where the n is a number of parallel jobs you want to run your tests on. - # Use a higher number if you have slow tests to split them between more parallel jobs. - # Remember to update the value of the `ci_node_index` below to (0..n-1). - ci_node_total: [10] - # Indexes for parallel jobs (starting from zero). - # E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc. - ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - steps: - - uses: actions/checkout@v3 - - - name: Setup redis - uses: supercharge/redis-github-action@1.4.0 - with: - redis-version: 6 - - - 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@v3 - with: - node-version: 16 - - - name: Install JS dependencies - run: yarn install --frozen-lockfile - - - name: Set up database - run: | - bundle exec rake db:create - bundle exec rake db:schema:load - - - name: Run tests - - env: - KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: e3b8800198d2d89b70c7edbdd85f8fd8 - KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_PRO_LOG_LEVEL: info - # if you use Knapsack Pro Queue Mode you must set below env variable - # to be able to retry CI build and run previously recorded tests - # https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node - # KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false - # RSpec split test files by test examples feature - it's optional - # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it - #KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true - KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN: "{engines/**{,/*/**}/*_spec.rb,spec/models/**{,/*/**}/*_spec.rb,spec/controllers/**{,/*/**}/*_spec.rb,spec/serializers/**{,/*/**}/*_spec.rb,spec/lib/**{,/*/**}/*_spec.rb,spec/migrations/**{,/*/**}/*_spec.rb,spec/system/**{,/*/**}/*_spec.rb}" - - - run: | - bundle exec rake knapsack_pro:rspec -