Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 32 additions & 56 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
branches:
- master


defaults:
run:
shell: bash

jobs:
main:
name: Run all tests
Expand All @@ -19,24 +24,14 @@ jobs:
fail-fast: false
matrix:
compiler: [
{
version: dmd-latest,
dmd: dmd
},
{
version: ldc-latest,
dmd: ldmd2
},
{
# Install dmd for the associated tools (dub/rdmd)
version: dmd-latest,
dmd: gdc-12
}
dmd-latest,
ldc-latest,
gdc-12,
]
host: [
ubuntu-22.04,
macos-latest,
windows-latest
windows-latest,
]
build: [
{ type: make },
Expand All @@ -50,32 +45,13 @@ jobs:

exclude:
# Restrict GDC to Ubuntu
- compiler:
dmd: gdc-12
- compiler: gdc-12
host: windows-latest
- compiler:
dmd: gdc-12
host: macos-latest

# Restrict DMD to macOS latest
- compiler:
dmd: dmd
- compiler: gdc-12
host: macos-latest

# Omit dub builds for GDC because dub rejects the old fronted revision
- compiler:
dmd: gdc-12
build:
type: dub
include:
- { do_report: 1, build: { type: dub, version: 'current' }, host: 'ubuntu-22.04', compiler: { version: dmd-latest, dmd: dmd } }

- compiler:
dmd: dmd
host: macos-13
build:
type: 'dub'
version: 'current'
- { do_report: 1, build: { type: dub, version: 'current' }, host: 'ubuntu-22.04', compiler: dmd-latest }

runs-on: ${{ matrix.host }}

Expand All @@ -87,27 +63,30 @@ jobs:
submodules: 'recursive'
fetch-depth: 0

# Install the host compiler (DMD or LDC)
# Also grabs DMD for GDC to include dub + rdmd
- name: Install ${{ matrix.compiler.version }}
if: ${{ matrix.compiler.dmd != 'gdc-12' || matrix.build.type == 'dub' }} # Fetch required tools for GDC
uses: dlang-community/setup-dlang@v1
- name: Install Dlang tools (for gdc)
if: ${{ startsWith(matrix.compiler, 'gdc') }}
uses: dlang-community/setup-dlang@v2

# Install the host compiler
- name: Install ${{ matrix.compiler }}
uses: dlang-community/setup-dlang@v2
with:
compiler: ${{ matrix.compiler.version }}
compiler: ${{ matrix.compiler }}

# GDC not yet supported by setup-dlang
- name: Install GDC via apt-get
if: ${{ matrix.compiler.dmd == 'gdc-12' }}
- 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: |
sudo apt-get install gdc-12 -y
gdc-12 --version
cat <<EOF | sudo tee -a /etc/dmd.conf
[Environment]
DFLAGS=-allinst -q,-Wno-error
EOF

# Compile D-Scanner and execute all tests without dub
- name: Build and test without dub
if: ${{ matrix.build.type == 'make' }}
env:
DC: ${{ matrix.compiler.dmd }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
export MFLAGS="-m64"
Expand All @@ -122,27 +101,26 @@ jobs:
- name: Build and test with dub (min or max libdparse test)
if: ${{ matrix.build.type == 'dub' && matrix.build.version != 'current' }}
env:
DC: ${{ matrix.compiler.dmd }}
DC: ${{ env.DMD }}
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 test

- name: Build and test with dub (with dub.selections.json)
if: ${{ matrix.build.type == 'dub' && matrix.build.version == 'current' }}
env:
DC: ${{ matrix.compiler.dmd }}
DC: ${{ env.DMD }}
run: |
dub build
dub test

- uses: actions/upload-artifact@v4
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

# Lint source code using the previously built binary
- name: Run linter
shell: bash
env:
REPORT_GITHUB: ${{matrix.do_report}}
run: |
Expand All @@ -161,7 +139,6 @@ jobs:
- name: Integration Tests
run: ./it.sh
working-directory: tests
shell: bash

# Parse phobos to check for failures / crashes / ...
- name: Checkout Phobos
Expand All @@ -173,7 +150,6 @@ jobs:
- name: Apply D-Scanner to Phobos
if: ${{ matrix.build.version != 'min libdparse'}} # Older versions crash with "Invalid UTF..."
working-directory: phobos
shell: bash
run: |
for FILE in $(find std -name '*.d');
do
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ override DMD_TEST_FLAGS += -w

DC_DEBUG_FLAGS := -g -Jbin

ifeq ($(DC), $(filter $(DC), dmd ldmd2 gdmd))
ifneq (,$(findstring dmd, $(DC)))
VERSIONS := $(DMD_VERSIONS)
DEBUG_VERSIONS := $(DMD_DEBUG_VERSIONS)
DC_FLAGS += $(DMD_FLAGS)
Expand Down
2 changes: 1 addition & 1 deletion src/dscanner/analysis/mismatched_args.d
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class MismatchedArgumentCheck : BaseAnalyzer
{
// The cast is a hack because .array() confuses the compiler's overload
// resolution code.
const(istring)[] params = sym is null ? [] : sym.argNames[].map!(a => cast() a).array();
const(istring)[] params = sym is null ? [] : sym.functionParameters.map!(a => a.name).array();
const ArgMismatch[] mismatches = compareArgsToParams(params, args);
if (mismatches.length == 0)
matched = true;
Expand Down