This commit is contained in:
Andrei Horodniceanu 2025-07-06 10:11:11 +00:00 committed by GitHub
commit 004155c38a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 36 additions and 14 deletions

View File

@ -15,20 +15,42 @@ permissions:
jobs: jobs:
build: build:
strategy:
runs-on: ubuntu-latest fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
dc: [dmd, ldc]
include:
- { os: ubuntu-latest, dc: gdc-14 }
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: dlang-community/setup-dlang@4c99aa991ce7d19dd3064de0a4f2f6b2f152e2d7 - uses: dlang-community/setup-dlang@v2
with:
compiler: ${{ matrix.dc }}
dub: latest
- name: Setup gdc specific environment
if: ${{ startsWith(matrix.dc, 'gdc') }}
run: |
tee -a ${GITHUB_ENV} <<<"DC=${DMD}"
# Linking errors without -allinst
# No other easy way to pass this to dub, using DFLAGS in the
# environment disables unittests
cat <<-EOF | sudo tee -a /etc/dmd.conf
[Environment]
DFLAGS=-allinst
EOF
- name: 'Build & Test' - name: 'Build & Test'
shell: bash
run: | run: |
# Build the project, with its main file included, without unittests # Build the project, with its main file included, without unittests
dub build --compiler=$DC dub build
# Build and run tests, as defined by `unittest` configuration # Build and run tests, as defined by `unittest` configuration
# In this mode, `mainSourceFile` is excluded and `version (unittest)` are included # In this mode, `mainSourceFile` is excluded and `version (unittest)` are included
# See https://dub.pm/package-format-json.html#configurations # See https://dub.pm/package-format-json.html#configurations
dub test --compiler=$DC dub test
# Run tests # Run tests
cd tests && rdmd test cd tests && "${DMD}" -run test.d