diff --git a/back_workflows/append_release.yml b/.github/workflows/append_release.yml similarity index 100% rename from back_workflows/append_release.yml rename to .github/workflows/append_release.yml diff --git a/back_workflows/automated_docker_release.yml b/.github/workflows/automated_docker_release.yml similarity index 100% rename from back_workflows/automated_docker_release.yml rename to .github/workflows/automated_docker_release.yml diff --git a/back_workflows/automated_release.yml b/.github/workflows/automated_release.yml similarity index 100% rename from back_workflows/automated_release.yml rename to .github/workflows/automated_release.yml diff --git a/back_workflows/check_docker_build.yml b/.github/workflows/check_docker_build.yml similarity index 100% rename from back_workflows/check_docker_build.yml rename to .github/workflows/check_docker_build.yml diff --git a/back_workflows/check_release_version.yml b/.github/workflows/check_release_version.yml similarity index 100% rename from back_workflows/check_release_version.yml rename to .github/workflows/check_release_version.yml diff --git a/back_workflows/cucumber_test.yml b/.github/workflows/cucumber_test.yml similarity index 100% rename from back_workflows/cucumber_test.yml rename to .github/workflows/cucumber_test.yml diff --git a/back_workflows/js_test.yml b/.github/workflows/js_test.yml similarity index 100% rename from back_workflows/js_test.yml rename to .github/workflows/js_test.yml diff --git a/back_workflows/lint.yml b/.github/workflows/lint.yml similarity index 100% rename from back_workflows/lint.yml rename to .github/workflows/lint.yml diff --git a/.github/workflows/ruby_test.yml b/.github/workflows/ruby_test.yml index ef55cf8e22..f0f1445d1a 100644 --- a/.github/workflows/ruby_test.yml +++ b/.github/workflows/ruby_test.yml @@ -13,6 +13,125 @@ on: - pull_request jobs: + rake_tests: + runs-on: ubuntu-latest + env: + RAILS_ENV: test + BUNDLE_WITHOUT: "cucumber deployment profile development" + # Services + # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idservices + services: + mysql: + # Use the Mysql docker image https://hub.docker.com/_/mysql + image: mysql:8.0 + ports: + - 3306 # Default port mappings + # Monitor the health of the container to mesaure when it is ready + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + env: + MYSQL_ROOT_PASSWORD: "" # Set root PW to nothing + MYSQL_ALLOW_EMPTY_PASSWORD: yes + 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 + - name: Setup environment + env: + DBPORT: ${{ job.services.mysql.ports[3306] }} + run: | + bin/setup + # Actually run our tests + - name: Run rake tests + env: + DBPORT: ${{ job.services.mysql.ports[3306] }} + run: bundle exec rake test + - name: Upload coverage artifact + uses: actions/upload-artifact@v2 + with: + name: codeclimate-${{ github.job }}-${{ matrix.ci_node_index }} + path: coverage/coverage.json + retention-days: 1 + rspec_tests: + runs-on: ubuntu-latest + env: + RAILS_ENV: test + BUNDLE_WITHOUT: "cucumber deployment profile development" + # Services + # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idservices + services: + mysql: + # Use the Mysql docker image https://hub.docker.com/_/mysql + image: mysql:8.0 + ports: + - 3306 # Default port mappings + # Monitor the health of the container to mesaure when it is ready + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + env: + MYSQL_ROOT_PASSWORD: "" # Set root PW to nothing + MYSQL_ALLOW_EMPTY_PASSWORD: yes + # Sets up the matrix for knapsack builds + strategy: + matrix: + ci_node_total: [3] + ci_node_index: [0, 1, 2] + 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 + # Establish a cache of js modules to improve performance + - name: Setup node + uses: actions/setup-node@v2 + with: + node-version: "16" + - name: Cache js + uses: actions/cache@v2 + with: + path: | + public/assets + node_modules + key: ${{ runner.os }}-tests-${{ hashFiles('yarn.lock') }} + # If we don't find the specific cache we want, fallback to the last raketests + # cache, then finally any cache for this repo. + # Github looks for the newest cache beginning with the first entry, before + # falling back the the second if none is present. + restore-keys: | + ${{ runner.os }}-tests- + ${{ runner.os }}- + # Install only the gems needed for testing + # Keep an eye on https://github.com/rubygems/bundler-features/issues/59 + # in case bundler add an only flag + # We also set the install path to vendor/bundle to assist with out caching + # bin/setup handles the rest of the configuration for us. + - name: Setup environment + env: + DBPORT: ${{ job.services.mysql.ports[3306] }} + run: | + bin/setup + bundle exec rake assets:precompile + # Actually run our tests + - name: Run rspec tests + env: + CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + CI_NODE_INDEX: ${{ matrix.ci_node_index }} + DBPORT: ${{ job.services.mysql.ports[3306] }} + run: bin/knapsack_pro_rspec + - name: Upload capybara artifacts + uses: actions/upload-artifact@v2 + if: ${{ failure() }} + with: + name: capybara-${{ github.job }}-${{ matrix.ci_node_index }} + path: tmp/capybara/ + retention-days: 5 + - name: Upload coverage artifact + uses: actions/upload-artifact@v2 + with: + name: codeclimate-${{ github.job }}-${{ matrix.ci_node_index }} + path: coverage/coverage.json + retention-days: 1 cucumber_tests: runs-on: ubuntu-latest env: @@ -81,3 +200,18 @@ jobs: name: codeclimate-${{ github.job }}-${{ matrix.ci_node_index }} path: coverage/coverage.json retention-days: 1 + end_coverage: + runs-on: ubuntu-latest + needs: [rake_tests, rspec_tests, cucumber_tests] + continue-on-error: true + steps: + - uses: actions/checkout@v2 + - name: Fetch coverage results + uses: actions/download-artifact@v2 + with: + path: tmp/ + - name: Publish code coverage + uses: paambaati/codeclimate-action@v2.7.5 + with: + coverageLocations: | + ${{github.workspace}}/tmp/codeclimate-*/coverage.json:simplecov \ No newline at end of file diff --git a/back_workflows/ruby_test_next_rails.yml b/.github/workflows/ruby_test_next_rails.yml similarity index 100% rename from back_workflows/ruby_test_next_rails.yml rename to .github/workflows/ruby_test_next_rails.yml diff --git a/back_workflows/update-rubocop.yml b/.github/workflows/update-rubocop.yml similarity index 100% rename from back_workflows/update-rubocop.yml rename to .github/workflows/update-rubocop.yml diff --git a/back_workflows/ruby_test.yml b/back_workflows/ruby_test.yml deleted file mode 100644 index f0f1445d1a..0000000000 --- a/back_workflows/ruby_test.yml +++ /dev/null @@ -1,217 +0,0 @@ -name: Ruby Test -env: - TZ: Europe/London - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID || '9c624e5d90c5b319d678e06d66c7671f1661fda826436d475f9679b54be63e26' }} - KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }} - KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER }} - KNAPSACK_PRO_FIXED_QUEUE_SPLIT: true - KNAPSACK_PRO_LOG_LEVEL: info - SKIP_AUTOMATIC_GEM_INSTALLATION: true # Disable the bundle install in bin/setup - -on: - - push - - pull_request - -jobs: - rake_tests: - runs-on: ubuntu-latest - env: - RAILS_ENV: test - BUNDLE_WITHOUT: "cucumber deployment profile development" - # Services - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idservices - services: - mysql: - # Use the Mysql docker image https://hub.docker.com/_/mysql - image: mysql:8.0 - ports: - - 3306 # Default port mappings - # Monitor the health of the container to mesaure when it is ready - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - env: - MYSQL_ROOT_PASSWORD: "" # Set root PW to nothing - MYSQL_ALLOW_EMPTY_PASSWORD: yes - 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 - - name: Setup environment - env: - DBPORT: ${{ job.services.mysql.ports[3306] }} - run: | - bin/setup - # Actually run our tests - - name: Run rake tests - env: - DBPORT: ${{ job.services.mysql.ports[3306] }} - run: bundle exec rake test - - name: Upload coverage artifact - uses: actions/upload-artifact@v2 - with: - name: codeclimate-${{ github.job }}-${{ matrix.ci_node_index }} - path: coverage/coverage.json - retention-days: 1 - rspec_tests: - runs-on: ubuntu-latest - env: - RAILS_ENV: test - BUNDLE_WITHOUT: "cucumber deployment profile development" - # Services - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idservices - services: - mysql: - # Use the Mysql docker image https://hub.docker.com/_/mysql - image: mysql:8.0 - ports: - - 3306 # Default port mappings - # Monitor the health of the container to mesaure when it is ready - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - env: - MYSQL_ROOT_PASSWORD: "" # Set root PW to nothing - MYSQL_ALLOW_EMPTY_PASSWORD: yes - # Sets up the matrix for knapsack builds - strategy: - matrix: - ci_node_total: [3] - ci_node_index: [0, 1, 2] - 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 - # Establish a cache of js modules to improve performance - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: "16" - - name: Cache js - uses: actions/cache@v2 - with: - path: | - public/assets - node_modules - key: ${{ runner.os }}-tests-${{ hashFiles('yarn.lock') }} - # If we don't find the specific cache we want, fallback to the last raketests - # cache, then finally any cache for this repo. - # Github looks for the newest cache beginning with the first entry, before - # falling back the the second if none is present. - restore-keys: | - ${{ runner.os }}-tests- - ${{ runner.os }}- - # Install only the gems needed for testing - # Keep an eye on https://github.com/rubygems/bundler-features/issues/59 - # in case bundler add an only flag - # We also set the install path to vendor/bundle to assist with out caching - # bin/setup handles the rest of the configuration for us. - - name: Setup environment - env: - DBPORT: ${{ job.services.mysql.ports[3306] }} - run: | - bin/setup - bundle exec rake assets:precompile - # Actually run our tests - - name: Run rspec tests - env: - CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - CI_NODE_INDEX: ${{ matrix.ci_node_index }} - DBPORT: ${{ job.services.mysql.ports[3306] }} - run: bin/knapsack_pro_rspec - - name: Upload capybara artifacts - uses: actions/upload-artifact@v2 - if: ${{ failure() }} - with: - name: capybara-${{ github.job }}-${{ matrix.ci_node_index }} - path: tmp/capybara/ - retention-days: 5 - - name: Upload coverage artifact - uses: actions/upload-artifact@v2 - with: - name: codeclimate-${{ github.job }}-${{ matrix.ci_node_index }} - path: coverage/coverage.json - retention-days: 1 - cucumber_tests: - runs-on: ubuntu-latest - env: - RAILS_ENV: cucumber - BUNDLE_WITHOUT: "deployment profile development test" - # Services - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idservices - services: - mysql: - # Use the Mysql docker image https://hub.docker.com/_/mysql - image: mysql:8.0 - ports: - - 3306 # Default port mappings - # Monitor the health of the container to mesaure when it is ready - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - env: - MYSQL_ROOT_PASSWORD: "" # Set root PW to nothing - MYSQL_ALLOW_EMPTY_PASSWORD: yes - # Sets up the matrix for knapsack builds - strategy: - matrix: - ci_node_total: [2] - ci_node_index: [0, 1] - 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 - # Establish a cache of js modules to improve performance - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - cache: "yarn" - # Install only the gems needed for testing - # Keep an eye on https://github.com/rubygems/bundler-features/issues/59 - # in case bundler add an only flag - # We also set the install path to vendor/bundle to assist with out caching - # bin/setup handles the rest of the configuration for us. - - name: Setup environment - env: - DBPORT: ${{ job.services.mysql.ports[3306] }} - run: | - bin/setup - bundle exec rake assets:precompile - # Actually run our tests - - name: Run Cucumber tests - env: - CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - CI_NODE_INDEX: ${{ matrix.ci_node_index }} - KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} - KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} - DBPORT: ${{ job.services.mysql.ports[3306] }} - run: bin/knapsack_pro_cucumber - - name: Upload capybara artifacts - uses: actions/upload-artifact@v2 - if: ${{ failure() }} - with: - name: capybara-${{ github.job }}-${{ matrix.ci_node_index }} - path: tmp/capybara/ - retention-days: 5 - - name: Upload coverage artifact - uses: actions/upload-artifact@v2 - with: - name: codeclimate-${{ github.job }}-${{ matrix.ci_node_index }} - path: coverage/coverage.json - retention-days: 1 - end_coverage: - runs-on: ubuntu-latest - needs: [rake_tests, rspec_tests, cucumber_tests] - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Fetch coverage results - uses: actions/download-artifact@v2 - with: - path: tmp/ - - name: Publish code coverage - uses: paambaati/codeclimate-action@v2.7.5 - with: - coverageLocations: | - ${{github.workspace}}/tmp/codeclimate-*/coverage.json:simplecov \ No newline at end of file