Skip to content

add compiler auto to use dmd or ldc depending on architecture #263

add compiler auto to use dmd or ldc depending on architecture

add compiler auto to use dmd or ldc depending on architecture #263

Workflow file for this run

name: Test the action
on:
push:
branches:
- "v*"
pull_request:
branches:
- "*"
jobs:
verify:
name: Verify install
strategy:
max-parallel: 5
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dc:
[
ldc-1.19.0,
ldc-latest,
ldc-beta,
ldc-master,
# Need fix for https://issues.dlang.org/show_bug.cgi?id=22942 for macOS
dmd-2.099.1,
dmd-latest,
dmd-beta,
dmd-master,
"",
]
include:
- os: macOS-latest
arch: arm64
dc: ""
- os: macos-latest
arch: arm64
dc: ldc-1.30.0
- os: macOS-latest
arch: arm64
dc: ldc-latest
- os: macOS-latest
arch: arm64
dc: ldc-beta
- os: macOS-latest
arch: arm64
dc: ldc-master
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install D compiler
uses: ./
with:
compiler: ${{ matrix.dc }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify D compiler ($DC)
shell: bash
run: $DC .github/hello.d && ./hello
- name: Verify D compiler with explicit bitness ($DC)
if: ${{ env['DC'] == 'dmd' }}
shell: bash
run: $DC -m64 .github/hello.d && ./hello
- name: Verify D compiler ($DC, shared)
shell: bash
run: $DC -shared .github/hello.d && ./hello
- name: Verify D compiler (dub)
run: dub run --single -q .github/hello.d
- name: Install Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
- name: Ensure `dist/index.js` is up to date
env:
NODE_OPTIONS: "--openssl-legacy-provider"
run: |
set -euxo pipefail
npm ci
npm run build
# exclude dist/index.js.map (different on Windows)
git diff --stat --exit-code HEAD -- ':!dist/index.js.map'
shell: bash
dub:
name: Verify standalone DUB install
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
dc: [ ldc-latest, dmd-latest ]
dub: [ 1.19.0, 1.23.0, 1.24.0 ]
exclude:
# Excluded because those are actually Linux executables
- { os: windows-latest, dub: 1.19.0 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install D compiler
uses: ./
with:
compiler: ${{ matrix.dc }}
dub: ${{ matrix.dub }}
- name: Verify DUB version
shell: bash
run: |
if [[ ${{ matrix.dub }} == 'latest' ]]
then
DUB_VERSION_FOR_TEST=$(curl -s https://api.github.com/repos/dlang/dub/releases/latest | jq -r '.name | sub("v(?<v>.+)"; .v)')
else
DUB_VERSION_FOR_TEST=${{ matrix.dub }}
fi
echo "dub path is: `which dub`"
echo "dub version is: `dub --version`"
echo "We expect version: $DUB_VERSION_FOR_TEST"
if [[ "$(dub --version)" =~ "version $DUB_VERSION_FOR_TEST" ]]
then
echo "Match"
else
exit 1
fi