From 90beb15c6c98f69f23286648c1cf8c93070e08ff Mon Sep 17 00:00:00 2001 From: Julian Pasquale Date: Wed, 18 Dec 2024 16:49:09 -0300 Subject: [PATCH] Add ls and new step --- .github/workflows/ci.yml | 9 +++++---- bin/rspec | 16 ++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79b62806..e493369e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -187,11 +187,12 @@ jobs: uses: rootstrap/check_untracked_changes@v1 with: path: "./app/ ./spec/" - - name: Get app assets from running container + - name: Run LSs run: | - docker run -it -d --name rails_app api_base/test:latest "sleep infinity" - docker container cp rails_app:/src/app/coverage/. app/coverage/ - docker rm -f rails_app + ls + ls -a coverage + - name: Report to CodeClimate + run: ./cc-test-reporter format-coverage --output "coverage/coverage.${{ matrix.ci_node_index }}.json" - name: Upload partial coverage uses: actions/upload-artifact@v4 with: diff --git a/bin/rspec b/bin/rspec index 045f1319..d36e6fe5 100755 --- a/bin/rspec +++ b/bin/rspec @@ -3,16 +3,16 @@ require 'shellwords' require_relative 'helpers' require 'optparse' -options = {} -OptionParser.new do |opts| - opts.banner = "Usage: ./bin/rspec [options]" +if running_with_docker? + options = {} + OptionParser.new do |opts| + opts.banner = "Usage: ./bin/rspec [options]" - opts.on("-rm", "--remove-containers", "If provided, all services will be stopped after the test is completed.") do - options[:remove_containers] = true - end -end.parse! + opts.on("-rm", "--remove-containers", "If provided, all services will be stopped after the test is completed.") do + options[:remove_containers] = true + end + end.parse! -if running_with_docker? compose_command = "docker compose -f docker-compose.test.yml run --build web ./bin/rspec #{Shellwords.join(ARGV)}" if options[:remove_containers]