Skip to content

Commit

Permalink
.github/actions/verify-d-compiler: Perform the tests in separate dirs
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
the-horo committed Jul 14, 2024
1 parent c56aaa8 commit 82a56b5
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions .github/actions/verify-d-compiler/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 82a56b5

Please sign in to comment.