1919 unittest-single :
2020 runs-on : [GPU, unittest]
2121 environment : Testing
22- outputs :
23- total : ${{ steps.total.outputs.total }}
2422 steps :
2523 - uses : actions/checkout@v3
2624 with :
3735 docker compose exec ray-head bash -c '/root/.local/bin/uv pip install --system -e .\[all\]'
3836 docker compose exec ray-worker bash -c '/root/.local/bin/uv pip install --system -e .\[all\]'
3937
38+ - name : Print Pip Dependency Tree
39+ working-directory : dj-${{ github.run_id }}/.github/workflows/docker
40+ run : |
41+ docker compose exec ray-head bash -c '/root/.local/bin/uv pip install --system pipdeptree'
42+ docker compose exec ray-head bash -c 'pipdeptree'
43+
4044 - name : Clean dataset cache
4145 working-directory : dj-${{ github.run_id }}/.github/workflows/docker
4246 run : |
@@ -46,19 +50,15 @@ jobs:
4650 working-directory : dj-${{ github.run_id }}/.github/workflows/docker
4751 run : |
4852 docker compose exec -e OPENAI_BASE_URL=${{ secrets.OPENAI_BASE_URL }} -e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} ray-head bash -c 'python tests/run.py --tag standalone --mode regression'
53+ docker compose exec ray-head bash -c 'coverage combine'
54+ docker compose exec ray-head bash -c 'mv .coverage .coverage.standalone'
4955
5056 - name : Upload coverage report of standalone
5157 uses : actions/upload-artifact@v4
5258 with :
5359 name : coverage_report_standalone
5460 include-hidden-files : true
55- path : dj-${{ github.run_id }}/.coverage
56-
57- - name : Get Total Coverage Result
58- id : total
59- working-directory : dj-${{ github.run_id }}/.github/workflows/docker
60- run : |
61- echo "total=$(docker compose exec ray-head coverage report --format=total)" >> $GITHUB_OUTPUT
61+ path : dj-${{ github.run_id }}/.coverage.standalone
6262
6363 - name : Remove docker compose
6464 working-directory : dj-${{ github.run_id }}/.github/workflows/docker
@@ -99,14 +99,79 @@ jobs:
9999 working-directory : dj-${{ github.run_id }}/.github/workflows/docker
100100 run : |
101101 docker compose exec ray-head bash -c 'python tests/run.py --tag ray --mode regression'
102+ docker compose exec ray-head bash -c 'coverage combine'
103+ docker compose exec ray-head bash -c 'mv .coverage .coverage.ray'
102104
103105 - name : Upload coverage report of ray
104106 uses : actions/upload-artifact@v4
105107 with :
106108 name : coverage_report_ray
107109 include-hidden-files : true
110+ path : dj-${{ github.run_id }}/.coverage.ray
111+
112+ - name : Remove docker compose
113+ working-directory : dj-${{ github.run_id }}/.github/workflows/docker
114+ if : always()
115+ run : |
116+ docker compose down --remove-orphans
117+
118+ - name : Cleanup workspace
119+ if : always()
120+ run : |
121+ rm -rf dj-${{ github.run_id }}
122+
123+ combine-coverage :
124+ needs : [unittest-single, unittest-dist]
125+ runs-on : [GPU, unittest]
126+ outputs :
127+ total : ${{ steps.total.outputs.total }}
128+ steps :
129+ - uses : actions/checkout@v3
130+ with :
131+ path : dj-${{ github.run_id }}
132+ fetch-depth : 0
133+
134+ - name : Setup docker compose
135+ working-directory : dj-${{ github.run_id }}/.github/workflows/docker
136+ run : |
137+ docker compose up -d
138+
139+ - name : Install coverage
140+ working-directory : dj-${{ github.run_id }}/.github/workflows/docker
141+ run : |
142+ docker compose exec ray-head bash -c '/root/.local/bin/uv pip install --system coverage'
143+
144+ - name : Download Coverage Report Standalone
145+ uses : actions/download-artifact@v4
146+ with :
147+ name : coverage_report_standalone
148+ path : dj-${{ github.run_id }}
149+
150+ - name : Download Coverage Report Ray
151+ uses : actions/download-artifact@v4
152+ with :
153+ name : coverage_report_ray
154+ path : dj-${{ github.run_id }}
155+
156+ - name : Combine Coverage Reports
157+ working-directory : dj-${{ github.run_id }}/.github/workflows/docker
158+ run : |
159+ docker compose exec ray-head bash -c 'coverage combine'
160+ docker compose exec ray-head bash -c 'coverage report -m'
161+
162+ - name : Upload Overall Coverage Report
163+ uses : actions/upload-artifact@v4
164+ with :
165+ name : coverage_report_all
166+ include-hidden-files : true
108167 path : dj-${{ github.run_id }}/.coverage
109168
169+ - name : Get Total Coverage Result
170+ id : total
171+ working-directory : dj-${{ github.run_id }}/.github/workflows/docker
172+ run : |
173+ echo "total=$(docker compose exec ray-head coverage report --format=total)" >> $GITHUB_OUTPUT
174+
110175 - name : Remove docker compose
111176 working-directory : dj-${{ github.run_id }}/.github/workflows/docker
112177 if : always()
@@ -120,7 +185,7 @@ jobs:
120185
121186 dynamic-badge :
122187 runs-on : ubuntu-latest
123- needs : unittest-single
188+ needs : combine-coverage
124189 steps :
125190 - name : " Create badge"
126191 # https://gist.github.com/HYLcool/f856b14416f08f73d05d32fd992a9c29
@@ -130,7 +195,7 @@ jobs:
130195 gistID : f856b14416f08f73d05d32fd992a9c29
131196 filename : total_cov.json
132197 label : Coverage
133- message : ${{ needs.unittest-single .outputs.total }}%
198+ message : ${{ needs.combine-coverage .outputs.total }}%
134199 minColorRange : 60
135200 maxColorRange : 90
136201 valColorRange : ${{ needs.unittest-single.outputs.total }}
0 commit comments