CI: bump setup-dlang to v2

Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
This commit is contained in:
Andrei Horodniceanu 2025-07-06 17:27:13 +03:00
parent b9510f2f96
commit 5efaf4faec
No known key found for this signature in database
GPG Key ID: D4D2730BE6398547
1 changed files with 33 additions and 57 deletions

View File

@ -7,6 +7,11 @@ on:
branches: branches:
- master - master
defaults:
run:
shell: bash
jobs: jobs:
main: main:
name: Run all tests name: Run all tests
@ -19,24 +24,14 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
compiler: [ compiler: [
{ dmd-latest,
version: dmd-latest, ldc-latest,
dmd: dmd gdc-12,
},
{
version: ldc-latest,
dmd: ldmd2
},
{
# Install dmd for the associated tools (dub/rdmd)
version: dmd-latest,
dmd: gdc-12
}
] ]
host: [ host: [
ubuntu-22.04, ubuntu-22.04,
macos-latest, macos-latest,
windows-latest windows-latest,
] ]
build: [ build: [
{ type: make }, { type: make },
@ -50,32 +45,13 @@ jobs:
exclude: exclude:
# Restrict GDC to Ubuntu # Restrict GDC to Ubuntu
- compiler: - compiler: gdc-12
dmd: gdc-12
host: windows-latest host: windows-latest
- compiler: - compiler: gdc-12
dmd: gdc-12
host: macos-latest host: macos-latest
# Restrict DMD to macOS latest
- compiler:
dmd: dmd
host: macos-latest
# Omit dub builds for GDC because dub rejects the old fronted revision
- compiler:
dmd: gdc-12
build:
type: dub
include: include:
- { do_report: 1, build: { type: dub, version: 'current' }, host: 'ubuntu-22.04', compiler: { version: dmd-latest, dmd: dmd } } - { do_report: 1, build: { type: dub, version: 'current' }, host: 'ubuntu-22.04', compiler: dmd-latest }
- compiler:
dmd: dmd
host: macos-13
build:
type: 'dub'
version: 'current'
runs-on: ${{ matrix.host }} runs-on: ${{ matrix.host }}
@ -87,27 +63,30 @@ jobs:
submodules: 'recursive' submodules: 'recursive'
fetch-depth: 0 fetch-depth: 0
# Install the host compiler (DMD or LDC) - name: Install Dlang tools (for gdc)
# Also grabs DMD for GDC to include dub + rdmd if: ${{ startsWith(matrix.compiler, 'gdc') }}
- name: Install ${{ matrix.compiler.version }} uses: dlang-community/setup-dlang@v2
if: ${{ matrix.compiler.dmd != 'gdc-12' || matrix.build.type == 'dub' }} # Fetch required tools for GDC
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.compiler.version }}
# GDC not yet supported by setup-dlang # Install the host compiler
- name: Install GDC via apt-get - name: Install ${{ matrix.compiler }}
if: ${{ matrix.compiler.dmd == 'gdc-12' }} uses: dlang-community/setup-dlang@v2
with:
compiler: ${{ matrix.compiler }}
- name: Setup DFLAGS for gdc
if: ${{ startsWith(matrix.compiler, 'gdc') }}
# Need to pass -allinst otherwise the build fails
# We can't simply use `DFLAGS=-allinst dub` since that
# disables unittests.
run: | run: |
sudo apt-get install gdc-12 -y cat <<EOF | sudo tee -a /etc/dmd.conf
gdc-12 --version [Environment]
DFLAGS=-allinst -q,-Wno-error
EOF
# Compile D-Scanner and execute all tests without dub # Compile D-Scanner and execute all tests without dub
- name: Build and test without dub - name: Build and test without dub
if: ${{ matrix.build.type == 'make' }} if: ${{ matrix.build.type == 'make' }}
env:
DC: ${{ matrix.compiler.dmd }}
shell: bash
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then if [ "$RUNNER_OS" == "Windows" ]; then
export MFLAGS="-m64" export MFLAGS="-m64"
@ -122,7 +101,7 @@ jobs:
- name: Build and test with dub (min or max libdparse test) - name: Build and test with dub (min or max libdparse test)
if: ${{ matrix.build.type == 'dub' && matrix.build.version != 'current' }} if: ${{ matrix.build.type == 'dub' && matrix.build.version != 'current' }}
env: env:
DC: ${{ matrix.compiler.dmd }} DC: ${{ env.DMD }}
run: | run: |
rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub build rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub build
rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub test rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub test
@ -130,19 +109,18 @@ jobs:
- name: Build and test with dub (with dub.selections.json) - name: Build and test with dub (with dub.selections.json)
if: ${{ matrix.build.type == 'dub' && matrix.build.version == 'current' }} if: ${{ matrix.build.type == 'dub' && matrix.build.version == 'current' }}
env: env:
DC: ${{ matrix.compiler.dmd }} DC: ${{ env.DMD }}
run: | run: |
dub build dub build
dub test dub test
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: bin-${{matrix.build.type}}-${{matrix.build.version}}-${{ matrix.compiler.dmd }}-${{ matrix.host }} name: bin-${{matrix.build.type}}-${{matrix.build.version}}-${{ matrix.compiler }}-${{ matrix.host }}
path: bin path: bin
# Lint source code using the previously built binary # Lint source code using the previously built binary
- name: Run linter - name: Run linter
shell: bash
env: env:
REPORT_GITHUB: ${{matrix.do_report}} REPORT_GITHUB: ${{matrix.do_report}}
run: | run: |
@ -161,7 +139,6 @@ jobs:
- name: Integration Tests - name: Integration Tests
run: ./it.sh run: ./it.sh
working-directory: tests working-directory: tests
shell: bash
# Parse phobos to check for failures / crashes / ... # Parse phobos to check for failures / crashes / ...
- name: Checkout Phobos - name: Checkout Phobos
@ -173,7 +150,6 @@ jobs:
- name: Apply D-Scanner to Phobos - name: Apply D-Scanner to Phobos
if: ${{ matrix.build.version != 'min libdparse'}} # Older versions crash with "Invalid UTF..." if: ${{ matrix.build.version != 'min libdparse'}} # Older versions crash with "Invalid UTF..."
working-directory: phobos working-directory: phobos
shell: bash
run: | run: |
for FILE in $(find std -name '*.d'); for FILE in $(find std -name '*.d');
do do