Skip to content

Commit aa9ad02

Browse files
authored
Uploading coverage at the merging to main. (#1735)
Some coverage improvements
1 parent b16cc20 commit aa9ad02

File tree

4 files changed

+93
-27
lines changed

4 files changed

+93
-27
lines changed

.github/workflows/Merge-main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Merge to main
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "*"
8+
branches:
9+
- main
10+
11+
env:
12+
DOCUMENTATION_CNAME: 'mapdl.docs.pyansys.com'
13+
14+
jobs:
15+
upload_dev_docs:
16+
name: 'Upload dev documentation'
17+
if: github.ref == 'refs/heads/main'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Deploy the latest documentation
21+
uses: pyansys/actions/[email protected]
22+
with:
23+
cname: ${{ env.DOCUMENTATION_CNAME }}
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
workflow: ci.yml
26+
commit: ${{github.event.pull.before}}
27+
28+
update_coverage:
29+
name: 'Update coverage report'
30+
if: github.ref == 'refs/heads/main'
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v3
34+
35+
- name: 'Download the previously generated coverage reports'
36+
uses: dawidd6/action-download-artifact@v2
37+
with:
38+
workflow: ci.yml
39+
commit: ${{github.event.pull.before}}
40+
path: ./artifacts
41+
github_token: ${{secrets.GITHUB_TOKEN}}
42+
43+
- name: "Display files structure"
44+
if: always()
45+
run: |
46+
echo "::group:: Display files structure" && ls -R && echo "::endgroup::"
47+
48+
- uses: codecov/codecov-action@v3
49+
name: "Upload coverage to Codecov"
50+
with:
51+
directory: ./artifacts/
52+
53+
54+

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,16 @@ jobs:
329329
330330
- uses: codecov/codecov-action@v3
331331
name: "Upload coverage to Codecov"
332+
with:
333+
name: "CentOS ${{ matrix.mapdl-version }} Local Coverage"
334+
path_to_write_report: ./coverage/centos_${{ matrix.mapdl-version }}_remote.xml
335+
flags: centos,remote
336+
337+
- name: Upload coverage artifacts
338+
uses: actions/upload-artifact@v3
339+
with:
340+
name: centos_${{ matrix.mapdl-version }}_remote.xml
341+
path: ./coverage/centos_${{ matrix.mapdl-version }}_remote.xml
332342

333343
- name: "Check package"
334344
run: |
@@ -465,6 +475,15 @@ jobs:
465475
name: "Upload coverage to Codecov"
466476
with:
467477
root_dir: ${{ github.workspace }}
478+
name: "Ubuntu Local Coverage"
479+
path_to_write_report: ./coverage/ubuntu_local.xml
480+
flags: ubuntu,local
481+
482+
- name: 'Upload coverage artifacts'
483+
uses: actions/upload-artifact@v3
484+
with:
485+
name: ubuntu_local.xml
486+
path: ./coverage/ubuntu_local.xml
468487

469488
test_windows:
470489
if: github.repository == ''
@@ -520,6 +539,18 @@ jobs:
520539
521540
- uses: codecov/codecov-action@v3
522541
name: "Upload coverage to Codecov"
542+
with:
543+
name: "Windows Local Coverage"
544+
path_to_write_report: ./coverage/windows_local.xml
545+
flags: windows,local
546+
547+
- name: Upload coverage artifacts
548+
uses: actions/upload-artifact@v3
549+
with:
550+
name: windows_local.xml
551+
path: ./coverage/windows_local.xml
552+
553+
523554

524555
release:
525556
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')

.github/workflows/dev-docs-publish.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

codecov.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@ ignore:
77
comment:
88
layout: "diff"
99
behavior: default
10+
require_changes: true # Avoid coverage comment if no files are changed.
1011

1112
coverage:
13+
range: 70..100
14+
round: down
15+
precision: 2
1216
status:
13-
project: false
17+
project:
18+
default:
19+
target: 80%
1420
patch:
1521
default:
1622
# basic
1723
target: 90%
1824
if_not_found: success
1925
if_ci_failed: error
2026
if_no_uploads: error
27+
threshold: 4% # Because some tests are flaky.

0 commit comments

Comments
 (0)