-
Notifications
You must be signed in to change notification settings - Fork 592
138 lines (116 loc) · 4.8 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Generate API Coverage
on:
workflow_dispatch:
push:
branches:
- java-coverage
jobs:
generate-cpp-coverage-report:
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Dependencies
uses: ./.github/actions/setup-dependencies
with:
use_ccache: false
- name: Generate C++ Coverage
working-directory: ./cpp
run: ../scripts/generate-code-coverage.sh
- name: Generate C++ Coverage Reports
working-directory: ./cpp
run: |
for binary in bin/*; do
../scripts/generate-code-coverage.sh "$binary"
done
for library in lib/*; do
if [[ $library =~ lib/lib[a-zA-Z0-9]+\.dylib ]]; then
../scripts/generate-code-coverage.sh "$library"
fi
done
# This will perform a full sync of the documentation to S3 every time the workflow is run since
# the timestamps will always be different. Using --size-only is not sufficient since the
# documentation may be updated without changing the size of the files. S3 does not offer a hash based sync.
- name: Sync Documentation to S3
working-directory: ./cpp/coverage/html
run: |
for coverage_dir in *; do
if [[ -d $coverage_dir ]]; then
aws s3 sync $coverage_dir s3://${AWS_S3_CODE_BUCKET}/ice/cpp/main/coverage/$(basename $coverage_dir) --delete
fi
done
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_CODE_BUCKET: ${{ secrets.AWS_S3_CODE_BUCKET }}
AWS_DEFAULT_REGION: us-east-1
if: github.ref == 'refs/heads/main'
generate-csharp-coverage-report:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Dependencies
uses: ./.github/actions/setup-dependencies
with:
use_ccache: false
- name: Build
run: |
make -C cpp srcs
make -C csharp
- name: Generate C# Coverage
working-directory: ./csharp
run: |
dotnet tool install dotnet-coverage --global
dotnet-coverage collect --server-mode --background --session-id dotnet-coverage --output coverage.cobertura.xml --output-format cobertura --settings msbuild/coverage.runsettings
python3 allTests.py --all --workers=4 --debug --coverage-session dotnet-coverage
dotnet-coverage shutdown dotnet-coverage
- name: Generate Coverage Reports
uses: danielpalme/ReportGenerator-GitHub-Action@5.3.8
with:
reports: csharp/coverage.cobertura.xml
targetdir: coveragereport
reporttypes: Html;Badges
license: ${{ secrets.REPORT_GENERATOR_LICENSE }}
- name: Sync Documentation to S3
working-directory: ./coveragereport
run: aws s3 sync . s3://${AWS_S3_CODE_BUCKET}/ice/csharp/main/coverage --delete
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_CODE_BUCKET: ${{ secrets.AWS_S3_CODE_BUCKET }}
AWS_DEFAULT_REGION: us-east-1
if: github.ref == 'refs/heads/main'
generate-java-coverage-report:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Dependencies
uses: ./.github/actions/setup-dependencies
with:
use_ccache: false
- name: Build
run: |
make -C cpp srcs
make -C java
- name: Generate Java Coverage
working-directory: ./java
run: |
wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.12/org.jacoco.cli-0.8.12-nodeps.jar
wget https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.12/org.jacoco.agent-0.8.12.jar
python3 allTests.py --all --workers=4 --debug --jacoco $(pwd)/org.jacoco.agent-0.8.12.jar
args=""
for pkg in src/*; do
args="$args --classfiles ./$pkg/build/classes/ --sourcefiles ./$pkg/src/main/java/"
done
java -jar org.jacoco.cli-0.8.12-nodeps.jar report $(find . -name \*.jacoco.exec) $args --html coverage
- name: Sync Documentation to S3
working-directory: ./java/coverage
run: aws s3 sync . s3://${AWS_S3_CODE_BUCKET}/ice/java/main/coverage --delete
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_CODE_BUCKET: ${{ secrets.AWS_S3_CODE_BUCKET }}
AWS_DEFAULT_REGION: us-east-1
# if: github.ref == 'refs/heads/main'