Skip to content

Commit 86b71a2

Browse files
authored
CI: Add self-compile step to GHA main jobs (#16586)
This test making sure that DMD can successfully build itself got lost when disabling/commenting-out the coverage jobs.
1 parent 515f395 commit 86b71a2

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.github/workflows/main.yml

+7
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ jobs:
163163
- name: Test phobos
164164
if: '!matrix.coverage'
165165
run: ci/run.sh test_phobos
166+
- name: Test self-compile
167+
if: '!matrix.coverage' # already re-built with enabled coverage
168+
run: ENABLE_RELEASE=0 ci/run.sh rebuild
166169
- name: Upload coverage report
167170
if: matrix.coverage
168171
run: ci/run.sh codecov
@@ -252,3 +255,7 @@ jobs:
252255
echo '::group::Test phobos'
253256
ci/run.sh test_phobos
254257
echo '::endgroup::'
258+
259+
echo '::group::Test self-compile'
260+
ENABLE_RELEASE=0 ci/run.sh rebuild
261+
echo '::endgroup::'

ci/run.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,22 @@ build() {
7777
# self-compile dmd
7878
rebuild() {
7979
local compare=${1:-0}
80+
81+
local dotexe=""
82+
local conf="dmd.conf"
83+
if [ "$OS_NAME" == "windows" ]; then
84+
dotexe=".exe"
85+
conf="sc.ini"
86+
fi
87+
8088
# `generated` gets cleaned in the next step, so we create another _generated
8189
# The nested folder hierarchy is needed to conform to those specified in
8290
# the generated dmd.conf
8391
mkdir -p _${build_path}
84-
cp $build_path/dmd _${build_path}/host_dmd
85-
cp $build_path/dmd.conf _${build_path}
92+
cp $build_path/dmd$dotexe _${build_path}/host_dmd$dotexe
93+
cp $build_path/$conf _${build_path}/
8694
rm -rf $build_path
87-
generated/build -j$N MODEL=$MODEL HOST_DMD=_${build_path}/host_dmd DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=${ENABLE_RELEASE:-1} dmd
95+
generated/build -j$N MODEL=$MODEL HOST_DMD=_${build_path}/host_dmd$dotexe DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=${ENABLE_RELEASE:-1} dmd
8896

8997
# compare binaries to test reproducible build
9098
if [ $compare -eq 1 ]; then

0 commit comments

Comments
 (0)