Skip to content

Commit 2ddb264

Browse files
committed
CI
Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
1 parent 7db5786 commit 2ddb264

2 files changed

Lines changed: 25 additions & 19 deletions

File tree

.github/workflows/main.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ jobs:
7474
- { dc: ldc-master, do_test: true }
7575
# Test on ARM64
7676
- { os: macOS-14, dc: ldc-latest, do_test: true }
77+
- { os: ubuntu-24.04, dc: gdc-13, do_test: false } # ice when building tests
78+
- { os: ubuntu-24.04, dc: gdc-14, do_test: true }
7779
exclude:
7880
# Error with those versions:
7981
# ld: multiple errors: symbol count from symbol table and dynamic symbol table differ in [.../dub.o]; address=0x0 points to section(2) with no content in '[...]/osx/lib/libphobos2.a[3177](config_a68_4c3.o)'
@@ -96,13 +98,31 @@ jobs:
9698
- name: '[Linux] Install dependencies'
9799
if: runner.os == 'Linux'
98100
run: |
99-
sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev netcat
101+
sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev netcat-openbsd
100102
101103
# Compiler to test with
102104
- name: Prepare compiler
103-
uses: dlang-community/setup-dlang@v1
105+
uses: dlang-community/setup-dlang@v2
104106
with:
105107
compiler: ${{ matrix.dc }}
108+
dub: latest # gdc doesn't come with dub
109+
110+
- name: Set environment variables
111+
shell: bash
112+
run: |
113+
for name in DC DMD; do
114+
var=${!name}
115+
var=$(basename "${var}")
116+
var=${var%.exe} # strip the extension
117+
export "${name}=${var}"
118+
tee -a ${GITHUB_ENV} <<<"${name}=${var}"
119+
done
120+
121+
if [[ "${{ startsWith(matrix.compiler, 'gdc') }}" ]]; then
122+
# build fails with gdmd without this
123+
tee -a ${GITHUB_ENV} <<<"DFLAGS=-q,-Wno-error -allinst"
124+
tee -a ${GITHUB_ENV} <<<"DC=${DMD}"
125+
fi
106126
107127
# Checkout the repository
108128
- name: Checkout
@@ -115,7 +135,6 @@ jobs:
115135
run: |
116136
dub build --compiler=${{ env.DC }}
117137
if [[ ${{ matrix.do_test }} == 'true' ]]; then
118-
dub run --compiler=${{ env.DC }} --single test/issue2051_running_unittests_from_dub_single_file_packages_fails.d
119138
./scripts/ci/ci.sh
120139
fi
121140
@@ -127,19 +146,7 @@ jobs:
127146
dub build --compiler=${{ env.DC }}
128147
if [[ ${{ matrix.do_test }} == 'true' ]]; then
129148
dub test --compiler=${{ env.DC }}
130-
dub run --compiler=${{ env.DC }} --single test/issue2051_running_unittests_from_dub_single_file_packages_fails.d
131-
dub --single test/run-unittest.d
132-
133-
# FIXME: DMD fails a few tests on Windows; remove them for now
134-
if [[ '${{ matrix.dc }}' = dmd* ]]; then
135-
# DLL support is lacking
136-
rm -rf test/{1-dynLib-simple,2-dynLib-dep,2-dynLib-with-staticLib-dep}
137-
# Unicode in paths too
138-
rm -rf test/issue130-unicode-СНА*
139-
# ImportC probably requires set-up MSVC environment variables
140-
rm -rf test/use-c-sources
141-
fi
142-
test/run-unittest.sh
149+
dub run --root test/run_unittest -- -v
143150
fi
144151
shell: bash
145152

scripts/ci/ci.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -v -e -o pipefail
44

55
vibe_ver=$(jq -r '.versions | .["vibe-d"]' < dub.selections.json)
66
dub fetch vibe-d@$vibe_ver # get optional dependency
7-
dub test --compiler=${DC} -c library-nonet
7+
dub test --compiler=${DC} -c library-nonet --build=unittest
88

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

@@ -18,5 +18,4 @@ else
1818
dub test --compiler=${DC} -b unittest-cov
1919
./build.d
2020
fi
21-
DUB=`pwd`/bin/dub DC=${DC} dub --single ./test/run-unittest.d
22-
DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
21+
dub run --root test/run_unittest -- -v

0 commit comments

Comments
 (0)