77 branches :
88 - master
99
10+
11+ defaults :
12+ run :
13+ shell : bash
14+
1015jobs :
1116 main :
1217 name : Run all tests
@@ -19,24 +24,14 @@ jobs:
1924 fail-fast : false
2025 matrix :
2126 compiler : [
22- {
23- version : dmd-latest,
24- dmd : dmd
25- },
26- {
27- version : ldc-latest,
28- dmd : ldmd2
29- },
30- {
31- # Install dmd for the associated tools (dub/rdmd)
32- version : dmd-latest,
33- dmd : gdc-12
34- }
27+ dmd-latest,
28+ ldc-latest,
29+ gdc-12,
3530 ]
3631 host : [
3732 ubuntu-22.04,
3833 macos-latest,
39- windows-latest
34+ windows-latest,
4035 ]
4136 build : [
4237 { type: make },
@@ -50,32 +45,13 @@ jobs:
5045
5146 exclude :
5247 # Restrict GDC to Ubuntu
53- - compiler :
54- dmd : gdc-12
48+ - compiler : gdc-12
5549 host : windows-latest
56- - compiler :
57- dmd : gdc-12
58- host : macos-latest
59-
60- # Restrict DMD to macOS latest
61- - compiler :
62- dmd : dmd
50+ - compiler : gdc-12
6351 host : macos-latest
6452
65- # Omit dub builds for GDC because dub rejects the old fronted revision
66- - compiler :
67- dmd : gdc-12
68- build :
69- type : dub
7053 include :
71- - { do_report: 1, build: { type: dub, version: 'current' }, host: 'ubuntu-22.04', compiler: { version: dmd-latest, dmd: dmd } }
72-
73- - compiler :
74- dmd : dmd
75- host : macos-13
76- build :
77- type : ' dub'
78- version : ' current'
54+ - { do_report: 1, build: { type: dub, version: 'current' }, host: 'ubuntu-22.04', compiler: dmd-latest }
7955
8056 runs-on : ${{ matrix.host }}
8157
@@ -87,27 +63,30 @@ jobs:
8763 submodules : ' recursive'
8864 fetch-depth : 0
8965
90- # Install the host compiler (DMD or LDC)
91- # Also grabs DMD for GDC to include dub + rdmd
92- - name : Install ${{ matrix.compiler.version }}
93- if : ${{ matrix.compiler.dmd != 'gdc-12' || matrix.build.type == 'dub' }} # Fetch required tools for GDC
94- uses : dlang-community/setup-dlang@v1
66+ - name : Install Dlang tools (for gdc)
67+ if : ${{ startsWith(matrix.compiler, 'gdc') }}
68+ uses : dlang-community/setup-dlang@v2
69+
70+ # Install the host compiler
71+ - name : Install ${{ matrix.compiler }}
72+ uses : dlang-community/setup-dlang@v2
9573 with :
96- compiler : ${{ matrix.compiler.version }}
74+ compiler : ${{ matrix.compiler }}
9775
98- # GDC not yet supported by setup-dlang
99- - name : Install GDC via apt-get
100- if : ${{ matrix.compiler.dmd == 'gdc-12' }}
76+ - name : Setup DFLAGS for gdc
77+ if : ${{ startsWith(matrix.compiler, 'gdc') }}
78+ # Need to pass -allinst otherwise the build fails
79+ # We can't simply use `DFLAGS=-allinst dub` since that
80+ # disables unittests.
10181 run : |
102- sudo apt-get install gdc-12 -y
103- gdc-12 --version
82+ cat <<EOF | sudo tee -a /etc/dmd.conf
83+ [Environment]
84+ DFLAGS=-allinst -q,-Wno-error
85+ EOF
10486
10587 # Compile D-Scanner and execute all tests without dub
10688 - name : Build and test without dub
10789 if : ${{ matrix.build.type == 'make' }}
108- env :
109- DC : ${{ matrix.compiler.dmd }}
110- shell : bash
11190 run : |
11291 if [ "$RUNNER_OS" == "Windows" ]; then
11392 export MFLAGS="-m64"
@@ -122,27 +101,26 @@ jobs:
122101 - name : Build and test with dub (min or max libdparse test)
123102 if : ${{ matrix.build.type == 'dub' && matrix.build.version != 'current' }}
124103 env :
125- DC : ${{ matrix.compiler.dmd }}
104+ DC : ${{ env.DMD }}
126105 run : |
127106 rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub build
128107 rdmd ./d-test-utils/test_with_package.d ${{ matrix.build.version }} -- dub test
129108
130109 - name : Build and test with dub (with dub.selections.json)
131110 if : ${{ matrix.build.type == 'dub' && matrix.build.version == 'current' }}
132111 env :
133- DC : ${{ matrix.compiler.dmd }}
112+ DC : ${{ env.DMD }}
134113 run : |
135114 dub build
136115 dub test
137116
138117 - uses : actions/upload-artifact@v4
139118 with :
140- name : bin-${{matrix.build.type}}-${{matrix.build.version}}-${{ matrix.compiler.dmd }}-${{ matrix.host }}
119+ name : bin-${{matrix.build.type}}-${{matrix.build.version}}-${{ matrix.compiler }}-${{ matrix.host }}
141120 path : bin
142121
143122 # Lint source code using the previously built binary
144123 - name : Run linter
145- shell : bash
146124 env :
147125 REPORT_GITHUB : ${{matrix.do_report}}
148126 run : |
@@ -161,7 +139,6 @@ jobs:
161139 - name : Integration Tests
162140 run : ./it.sh
163141 working-directory : tests
164- shell : bash
165142
166143 # Parse phobos to check for failures / crashes / ...
167144 - name : Checkout Phobos
@@ -173,7 +150,6 @@ jobs:
173150 - name : Apply D-Scanner to Phobos
174151 if : ${{ matrix.build.version != 'min libdparse'}} # Older versions crash with "Invalid UTF..."
175152 working-directory : phobos
176- shell : bash
177153 run : |
178154 for FILE in $(find std -name '*.d');
179155 do
0 commit comments