@@ -49,50 +49,57 @@ jobs:
4949
5050 steps :
5151 - name : Checkout code
52- uses : actions/checkout@v4
52+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
53+
5354 - name : Setup Scala
54- uses : olafurpg/setup-scala@v14
55+ uses : olafurpg/setup-scala@32ffa16635ff8f19cc21ea253a987f0fdf29844c
5556 with :
565758+
5759 - name : Prepare testing database
5860 run : sbt flywayMigrate
61+
5962 - name : Build and run tests
6063 continue-on-error : true
6164 id : jacocorun
6265 run : sbt ++${{env.scalaLong}} jacoco
66+
6367 - name : Add coverage to PR (core)
6468 if : steps.jacocorun.outcome == 'success'
6569 id : jacoco-core
66- uses : madrapps/jacoco-report@v1.6.1
70+ uses : madrapps/jacoco-report@50d3aff4548aa991e6753342d9ba291084e63848
6771 with :
6872 paths : ${{ github.workspace }}/core/target/scala-${{ env.scalaShort }}/jacoco/report/jacoco.xml
6973 token : ${{ secrets.GITHUB_TOKEN }}
7074 min-coverage-overall : ${{ env.coverage-overall }}
7175 min-coverage-changed-files : ${{ env.coverage-changed-files }}
7276 title : JaCoCo `core` module code coverage report - scala ${{ env.scalaLong }}
7377 update-comment : true
78+
7479 - name : Add coverage to PR (doobie)
7580 if : steps.jacocorun.outcome == 'success'
7681 id : jacoco-doobie
77- uses : madrapps/jacoco-report@v1.6.1
82+ uses : madrapps/jacoco-report@50d3aff4548aa991e6753342d9ba291084e63848
7883 with :
7984 paths : ${{ github.workspace }}/doobie/target/scala-${{ env.scalaShort }}/jacoco/report/jacoco.xml
8085 token : ${{ secrets.GITHUB_TOKEN }}
8186 min-coverage-overall : ${{ env.coverage-overall }}
8287 min-coverage-changed-files : ${{ env.coverage-changed-files }}
8388 title : JaCoCo `doobie` module code coverage report - scala ${{ env.scalaLong }}
8489 update-comment : true
90+
8591 - name : Add coverage to PR (slick)
8692 if : steps.jacocorun.outcome == 'success'
8793 id : jacoco-slick
88- uses : madrapps/jacoco-report@v1.6.1
94+ uses : madrapps/jacoco-report@50d3aff4548aa991e6753342d9ba291084e63848
8995 with :
9096 paths : ${{ github.workspace }}/slick/target/scala-${{ env.scalaShort }}/jacoco/report/jacoco.xml
9197 token : ${{ secrets.GITHUB_TOKEN }}
9298 min-coverage-overall : ${{env.coverage-overall }}
9399 min-coverage-changed-files : ${{ env.coverage-changed-files }}
94100 title : JaCoCo `slick` module code coverage report - scala ${{ env.scalaLong }}
95101 update-comment : true
102+
96103 - name : Get the Coverage info
97104 if : steps.jacocorun.outcome == 'success'
98105 run : |
@@ -102,9 +109,10 @@ jobs:
102109 echo "Changed Files coverage ${{ steps.jacoco-doobie.outputs.coverage-changed-files }}"
103110 echo "Total `slick` module coverage ${{ steps.jacoco-slick.outputs.coverage-overall }}"
104111 echo "Changed Files coverage ${{ steps.jacoco-slick.outputs.coverage-changed-files }}"
112+
105113 - name : Fail PR if changed files coverage is less than ${{ env.coverage-changed-files }}%
106114 if : steps.jacocorun.outcome == 'success'
107- uses : actions/github-script@v6
115+ uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
108116 with :
109117 script : |
110118 const coverageCheckFailed =
@@ -114,9 +122,10 @@ jobs:
114122 if (coverageCheckFailed) {
115123 core.setFailed('Changed files coverage is less than ${{ env.coverage-changed-files }}%!');
116124 }
125+
117126 - name : Fail PR if overall files coverage is less than ${{ env.coverage-overall }}%
118127 if : ${{ (steps.jacocorun.outcome == 'success') && (env.check-overall-coverages == 'true') }}
119- uses : actions/github-script@v6
128+ uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
120129 with :
121130 script : |
122131 const coverageCheckFailed =
@@ -126,9 +135,10 @@ jobs:
126135 if (coverageCheckFailed) {
127136 core.setFailed('Overall coverage is less than ${{ env.coverage-overall }}%!');
128137 }
138+
129139 - name : Edit JaCoCo comments on build failure
130140 if : steps.jacocorun.outcome != 'success'
131- uses : actions/github-script@v6
141+ uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
132142 with :
133143 script : |
134144 const issue_number = context.issue.number;
0 commit comments