From 82a56b52a916b0474b05d1cc04378ecec0cf77b7 Mon Sep 17 00:00:00 2001 From: Andrei Horodniceanu Date: Thu, 11 Jul 2024 20:37:18 +0300 Subject: [PATCH] .github/actions/verify-d-compiler: Perform the tests in separate dirs Avoid the possibility of mistakenly running a previously generated hello executable by performing all the steps in separate directories. This has shown an issue with the `-shared` test, it never produced an executable so invoking the program was useless as it run the one that was generated in the previous step. For this reason in that test perform only compilation and no longer run any binary. Signed-off-by: Andrei Horodniceanu --- .github/actions/verify-d-compiler/action.yml | 30 ++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/actions/verify-d-compiler/action.yml b/.github/actions/verify-d-compiler/action.yml index bb86ad1..52cfde8 100644 --- a/.github/actions/verify-d-compiler/action.yml +++ b/.github/actions/verify-d-compiler/action.yml @@ -25,28 +25,48 @@ runs: - name: Verify D compiler ($DC) shell: bash run: | - $DC .github/hello.d + mkdir -p d-ver-simple + pushd d-ver-simple + $DC ../.github/hello.d if [[ ${DC} == *gdc* ]]; then ./a.out else ./hello fi + popd - name: Verify D Compiler dmd-wrapper ($DMD) shell: bash - run: $DMD -run .github/hello.d + run: | + mkdir -p d-ver-run + pushd d-ver-run + $DMD -run ../.github/hello.d + popd - name: Verify D compiler with explicit bitness ($DC) if: ${{ startsWith(inputs.dc, 'dmd') }} shell: bash - run: $DC -m64 .github/hello.d && ./hello + run: | + mkdir -p d-ver-m + pushd d-ver-m + $DC -m64 ../.github/hello.d && ./hello + popd - name: Verify D compiler ($DC, shared) if: ${{ !startsWith(inputs.dc, 'g') }} # fails with gdc shell: bash - run: $DC -shared .github/hello.d && ./hello + run: | + mkdir -p d-ver-shared + pushd d-ver-shared + $DC -shared ../.github/hello.d + popd + - name: Verify D compiler (dub) if: ${{ !startsWith(inputs.dc, 'g') }} # dub doesn't come with gdc by default shell: bash - run: dub run --single -q .github/hello.d + run: | + mkdir -p d-ver-dub + pushd d-ver-dub + dub run --single -q ../.github/hello.d + popd