From 8b45bf14ee9cbcc5b54fad6725cd660066f2a144 Mon Sep 17 00:00:00 2001 From: lemonowl Date: Wed, 25 Dec 2024 13:20:28 +0300 Subject: [PATCH 1/7] fix comparing error --- .github/workflows/check.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9ec50c7b..b6e00e1c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,7 +26,12 @@ jobs: run_modified_files_in_default_docker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout HEAD + uses: actions/checkout@v4 + - name: Checkout master + uses: actions/checkout@v4 + with: + ref: master - name: Running test inside doc-builder-testing run: | docker build -t doc-builder-testing . From 4ebf8b21a1ed08abd1f595a059ce43ca5d0a8ee8 Mon Sep 17 00:00:00 2001 From: lemonowl Date: Wed, 25 Dec 2024 13:28:12 +0300 Subject: [PATCH 2/7] fix comparing error --- .github/workflows/check.yml | 8 ++++---- Rakefile | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b6e00e1c..83eddcfd 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,10 +28,10 @@ jobs: steps: - name: Checkout HEAD uses: actions/checkout@v4 - - name: Checkout master - uses: actions/checkout@v4 - with: - ref: master +# - name: Checkout master +# uses: actions/checkout@v4 +# with: +# ref: master - name: Running test inside doc-builder-testing run: | docker build -t doc-builder-testing . diff --git a/Rakefile b/Rakefile index c2fb64ba..70a292a2 100644 --- a/Rakefile +++ b/Rakefile @@ -37,7 +37,7 @@ task :in_modified_specs do # get changes in framework lib_diff = `git diff --name-only origin/master -- lib dockerfiles Dockerfile Gemfile Gemfile.lock` - run_default = true unless lib_diff.empty? + run_default = true if !lib_diff.empty? || lib_diff.include?('fatal:') # get changes in scripts and find them in spec scripts_diff = `git diff --name-only origin/master -- js python | xargs -I {} grep -Rl {} spec` From 4d86b9d6533116532279710f4495d35d91851dde Mon Sep 17 00:00:00 2001 From: lemonowl Date: Wed, 25 Dec 2024 13:37:41 +0300 Subject: [PATCH 3/7] fix comparing error --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 70a292a2..a02d04db 100644 --- a/Rakefile +++ b/Rakefile @@ -36,7 +36,7 @@ task :in_modified_specs do run_default = false # get changes in framework - lib_diff = `git diff --name-only origin/master -- lib dockerfiles Dockerfile Gemfile Gemfile.lock` + lib_diff = `git diff --name-only origin/master -- lib dockerfiles Dockerfile Gemfile Gemfile.lock 2>&1` run_default = true if !lib_diff.empty? || lib_diff.include?('fatal:') # get changes in scripts and find them in spec From f801009c94916f3c6fa3663fafa6bde8cc31c450 Mon Sep 17 00:00:00 2001 From: lemonowl Date: Wed, 25 Dec 2024 13:43:20 +0300 Subject: [PATCH 4/7] fix comparing error --- .github/workflows/check.yml | 8 ++++---- Rakefile | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 83eddcfd..b6e00e1c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,10 +28,10 @@ jobs: steps: - name: Checkout HEAD uses: actions/checkout@v4 -# - name: Checkout master -# uses: actions/checkout@v4 -# with: -# ref: master + - name: Checkout master + uses: actions/checkout@v4 + with: + ref: master - name: Running test inside doc-builder-testing run: | docker build -t doc-builder-testing . diff --git a/Rakefile b/Rakefile index a02d04db..8c4819db 100644 --- a/Rakefile +++ b/Rakefile @@ -45,11 +45,13 @@ task :in_modified_specs do spec_diff = `git diff --name-only origin/master -- spec ':!spec/spec_helper.rb' ':!spec/test_data.rb'` files = spec_diff.split | scripts_diff.split - if files.all? { |element| element =~ %r{^spec/.*\.rb} } - files.empty? ? print('NO TESTS TO RUN.') : sh("bundle exec parallel_rspec #{files.join(' ')}") - else - print("An incorrect file type for rspec has been detected: #{files}") - run_default = true + unless run_default + if files.all? { |element| element =~ %r{^spec/.*\.rb} } + files.empty? ? print('NO TESTS TO RUN.') : sh("bundle exec parallel_rspec #{files.join(' ')}") + else + print("An incorrect file type for rspec has been detected: #{files}") + run_default = true + end end Rake::Task['default'].invoke if run_default From 91373667b387aa964757bea8d7db4b8359ad54f3 Mon Sep 17 00:00:00 2001 From: lemonowl Date: Thu, 26 Dec 2024 17:24:28 +0300 Subject: [PATCH 5/7] add comments --- .github/workflows/check.yml | 2 ++ Rakefile | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b6e00e1c..9c47ed50 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,8 +26,10 @@ jobs: run_modified_files_in_default_docker: runs-on: ubuntu-latest steps: + # pull current branch - name: Checkout HEAD uses: actions/checkout@v4 + # pull master to run git diff command - name: Checkout master uses: actions/checkout@v4 with: diff --git a/Rakefile b/Rakefile index 8c4819db..68d5b771 100644 --- a/Rakefile +++ b/Rakefile @@ -37,6 +37,7 @@ task :in_modified_specs do # get changes in framework lib_diff = `git diff --name-only origin/master -- lib dockerfiles Dockerfile Gemfile Gemfile.lock 2>&1` + # check of comparison results/errors run_default = true if !lib_diff.empty? || lib_diff.include?('fatal:') # get changes in scripts and find them in spec From b0c44f725e94a58534058c2ccdfc9212e8fba1b0 Mon Sep 17 00:00:00 2001 From: lemonowl Date: Thu, 26 Dec 2024 17:35:55 +0300 Subject: [PATCH 6/7] fix --- .github/workflows/check.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9c47ed50..411377d4 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,14 +26,12 @@ jobs: run_modified_files_in_default_docker: runs-on: ubuntu-latest steps: - # pull current branch + # Pull current branch - name: Checkout HEAD uses: actions/checkout@v4 - # pull master to run git diff command - - name: Checkout master - uses: actions/checkout@v4 - with: - ref: master + # Fetch master branch to run git diff command + - name: Fetch master branch + run: git fetch origin master - name: Running test inside doc-builder-testing run: | docker build -t doc-builder-testing . From 53d5a82205150d6a6d8c867fdfbea5916fa5ba9f Mon Sep 17 00:00:00 2001 From: lemonowl Date: Thu, 26 Dec 2024 17:55:49 +0300 Subject: [PATCH 7/7] fix workflow actions --- .github/workflows/check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 411377d4..329032cf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,12 +26,12 @@ jobs: run_modified_files_in_default_docker: runs-on: ubuntu-latest steps: - # Pull current branch - name: Checkout HEAD uses: actions/checkout@v4 - # Fetch master branch to run git diff command + with: + fetch-depth: 0 # Fetch the full history to access other branches - name: Fetch master branch - run: git fetch origin master + run: git fetch origin master # Fetch the master branch - name: Running test inside doc-builder-testing run: | docker build -t doc-builder-testing .