Skip to content

Commit

Permalink
Build the tests and binary with -cov on POSIX
Browse files Browse the repository at this point in the history
The CI was sending empty coverage reports because nothing
was being generated, as the variable was always false.
In the process, a bit of dead code was removed.
  • Loading branch information
Geod24 committed Jan 23, 2024
1 parent a2a0593 commit ef0bf93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ jobs:
- name: '[POSIX] Test'
if: runner.os != 'Windows'
env:
COVERAGE: false
# The value doesn't matter as long as it's > 2.087
FRONTEND: 2.095.0
COVERAGE: true
run: |
dub build --compiler=${{ env.DC }}
if [[ ${{ matrix.do_test }} == 'true' ]]; then
Expand Down
14 changes: 1 addition & 13 deletions scripts/ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,12 @@ dub test --compiler=${DC} -c library-nonet

export DMD="$(command -v $DMD)"

if [ "$FRONTEND" \> 2.087.z ]; then
./build.d -preview=dip1000 -preview=in -w -g -debug
fi

function clean() {
# Hard reset of the DUB local folder is necessary as some tests
# currently don't properly clean themselves
rm -rf ~/.dub
git clean -dxf -- test
}
./build.d -preview=dip1000 -preview=in -w -g -debug

if [ "$COVERAGE" = true ]; then
# library-nonet fails to build with coverage (Issue 13742)
dub test --compiler=${DC} -b unittest-cov
./build.d -cov

wget https://codecov.io/bash -O codecov.sh
bash codecov.sh
else
./build.d
DUB=`pwd`/bin/dub DC=${DC} dub --single ./test/run-unittest.d
Expand Down

0 comments on commit ef0bf93

Please sign in to comment.