[CI] Move code-coverage upload into isolated process (#19532)
This commit is contained in:
parent
795cfc3da0
commit
a6a3417e5e
3 changed files with 49 additions and 13 deletions
58
.github/workflows/ci-cd.yml
vendored
58
.github/workflows/ci-cd.yml
vendored
|
|
@ -188,12 +188,14 @@ jobs:
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: rspec-artifacts
|
name: rspec-artifacts
|
||||||
path: |
|
path: tmp/capybara
|
||||||
tmp/capybara
|
- name: Rename folder
|
||||||
- uses: codecov/codecov-action@v3
|
run: mv coverage/simplecov coverage/simplecov-${{ matrix.ci_node_index }}
|
||||||
|
- name: Upload test coverage result
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
flags: ruby
|
name: coverage
|
||||||
fail_ci_if_error: false
|
path: coverage/
|
||||||
- name: Upload test results to BuildPulse for flaky test detection
|
- name: Upload test results to BuildPulse for flaky test detection
|
||||||
if: '!cancelled()' # Run this step even when the tests fail. Skip if the workflow is cancelled.
|
if: '!cancelled()' # Run this step even when the tests fail. Skip if the workflow is cancelled.
|
||||||
uses: Workshop64/buildpulse-action@master
|
uses: Workshop64/buildpulse-action@master
|
||||||
|
|
@ -231,10 +233,11 @@ jobs:
|
||||||
path: junit.xml
|
path: junit.xml
|
||||||
key: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID }}
|
key: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID }}
|
||||||
secret: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
|
secret: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
|
||||||
- uses: codecov/codecov-action@v3
|
- name: Upload test coverage result
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
flags: jest, javascript
|
name: coverage
|
||||||
fail_ci_if_error: false
|
path: coverage/
|
||||||
|
|
||||||
storybook:
|
storybook:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -383,10 +386,15 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
tmp/cypress_screenshots
|
tmp/cypress_screenshots
|
||||||
cypress/logs
|
cypress/logs
|
||||||
- uses: codecov/codecov-action@v3
|
- name: rename folder
|
||||||
|
run: |
|
||||||
|
rm -rf coverage/cypress/lcov-report
|
||||||
|
mv coverage/cypress coverage/cypress-${{ matrix.ci_node_index }}
|
||||||
|
- name: Upload test coverage result
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
flags: cypress, javascript
|
name: coverage
|
||||||
fail_ci_if_error: false
|
path: coverage/
|
||||||
- name: Upload test results to BuildPulse for flaky test detection
|
- name: Upload test results to BuildPulse for flaky test detection
|
||||||
if: '!cancelled()' # Run this step even when the tests fail. Skip if the workflow is cancelled.
|
if: '!cancelled()' # Run this step even when the tests fail. Skip if the workflow is cancelled.
|
||||||
uses: Workshop64/buildpulse-action@master
|
uses: Workshop64/buildpulse-action@master
|
||||||
|
|
@ -397,6 +405,34 @@ jobs:
|
||||||
key: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID }}
|
key: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID }}
|
||||||
secret: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
|
secret: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
|
||||||
|
|
||||||
|
upload-coverage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [rspec, jest, cypress]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: coverage
|
||||||
|
- run: |
|
||||||
|
mkdir coverage coverage/simplecov coverage/cypress
|
||||||
|
mv simplecov-* coverage/simplecov
|
||||||
|
mv cypress-* coverage/cypress
|
||||||
|
mv jest coverage/jest
|
||||||
|
- uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
flags: ruby
|
||||||
|
directory: coverage/simplecov
|
||||||
|
fail_ci_if_error: true
|
||||||
|
- uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
flags: jest, javascript
|
||||||
|
directory: coverage/jest
|
||||||
|
fail_ci_if_error: true
|
||||||
|
- uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
flags: cypress, javascript
|
||||||
|
directory: coverage/cypress
|
||||||
|
fail_ci_if_error: true
|
||||||
|
|
||||||
CI-status-report:
|
CI-status-report:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
unless ENV["COVERAGE"] == "false"
|
unless ENV["COVERAGE"] == "false"
|
||||||
|
SimpleCov.coverage_dir("coverage/simplecov")
|
||||||
SimpleCov.start "rails" do
|
SimpleCov.start "rails" do
|
||||||
add_filter "/spec/"
|
add_filter "/spec/"
|
||||||
add_filter "/app/controllers/admin/"
|
add_filter "/app/controllers/admin/"
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ codecov:
|
||||||
require_ci_to_pass: no
|
require_ci_to_pass: no
|
||||||
notify:
|
notify:
|
||||||
wait_for_ci: no
|
wait_for_ci: no
|
||||||
after_n_builds: 12 # Actually we have 18 total but this ensure we get a (incomplete) result even if some failed to upload
|
|
||||||
ignore:
|
ignore:
|
||||||
- "vendor"
|
- "vendor"
|
||||||
- "bin"
|
- "bin"
|
||||||
|
|
@ -23,4 +22,4 @@ coverage:
|
||||||
project: false
|
project: false
|
||||||
flag_management:
|
flag_management:
|
||||||
default_rules:
|
default_rules:
|
||||||
carryforward: true
|
carryforward: false
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue