diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 20c7696..435c91b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ jobs: name: imap-d D tests strategy: matrix: - os: [ubuntu-latest, ubuntu-20.04] + os: [ubuntu-latest, ubuntu-20.04, windows-latest] dc: [dmd-latest, ldc-latest] #, dmd-2.085.0, ldc-1.17.0 runs-on: ${{ matrix.os }} @@ -14,22 +14,21 @@ jobs: - uses: actions/checkout@v2 - name: Install D compiler - #https://github.com/dlang-community/setup-dlang - uses: dlang-community/setup-dlang@v1 + uses: dlang-community/setup-dlang@v1.1.1 with: compiler: ${{ matrix.dc }} - name: dub build - run: dub build --compiler=${DC} + run: dub build - name: Build example with dub - run: dub build --compiler=${DC} --root=example + run: dub build --root=example - name: Build test with dub - run: dub build --compiler=${DC} --root=test + run: dub build --root=test - name: Run all unittests with coverage - run: dub test --build=unittest-cov --compiler=${DC} + run: dub test --build=unittest-cov - name: Upload coverage to codecov uses: codecov/codecov-action@v2 diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 59f69e0..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,145 +0,0 @@ -image: Visual Studio 2017 -environment: - VS: 15 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - matrix: - - DC: ldc - DVersion: 1.21.0 - arch: x64 - - DC: dmd - DVersion: 2.091.1 - arch: x64 - -skip_tags: true - -install: - - ps: function ResolveDMD - { - $version = $env:DVersion; - if($version -eq "stable") { - $latest = (Invoke-WebRequest "http://downloads.dlang.org/releases/LATEST").toString(); - $urls = @("http://downloads.dlang.org/releases/2.x/$($latest)/dmd.$($latest).windows.7z", - "http://ftp.digitalmars.com/dmd.$($latest).windows.7z"); - }elseif($version -eq "beta") { - $latest = (Invoke-WebRequest "http://downloads.dlang.org/pre-releases/LATEST").toString(); - $latestVersion = $latest.split("-")[0].split("~")[0]; - $urls = @("http://downloads.dlang.org/pre-releases/2.x/$($latestVersion)/dmd.$($latest).windows.7z", - "http://ftp.digitalmars.com/dmd.$($latest).windows.7z"); - }elseif($version -eq "nightly") { - $latest = (Invoke-WebRequest "http://nightlies.dlang.org/$($version)/LATEST").toString(); - $urls = @("http://nightlies.dlang.org/dmd-$($latest)/dmd.master.windows.7z"); - }else { - $urls = @("http://downloads.dlang.org/releases/2.x/$($version)/dmd.$($version).windows.7z", - "http://ftp.digitalmars.com/dmd.$($version).windows.7z"); - } - $env:PATH += ";C:\dmd2\windows\bin;"; - return $urls; - } - - ps: function ResolveLDC - { - if($env:arch -eq "x86"){ - $archBits = "32"; - } - elseif($env:arch -eq "x64"){ - $archBits = "64"; - } - $version = $env:DVersion; - $arch = $env:arch; - if($version -eq "stable") { - $latest = (Invoke-WebRequest "https://ldc-developers.github.io/LATEST").toString().replace("`n","").replace("`r",""); - $urls = @("https://github.com/ldc-developers/ldc/releases/download/v$($latest)/ldc2-$($latest)-windows-$($arch).7z"); - }elseif($version -eq "beta") { - $latest = (Invoke-WebRequest "https://ldc-developers.github.io/LATEST_BETA").toString().replace("`n","").replace("`r",""); - $urls = @("https://github.com/ldc-developers/ldc/releases/download/v$($latest)/ldc2-$($latest)-windows-$($arch).7z"); - } else { - $latest = $version; - $urls = @("https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-windows-$($arch).7z"); - $urls += "https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-win$($archBits)-msvc.zip"; - } - $env:PATH += ";C:\ldc2-$($latest)-windows-$($arch)\bin;C:\ldc2-$($latest)-win$($archBits)-msvc\bin"; - $env:DC = "ldc2"; - return $urls; - } - - ps: function SetUpDCompiler - { - $env:toolchain = "msvc"; - if($env:DC -eq "dmd"){ - $env:DMD = "dmd"; - $urls = ResolveDMD; - } - elseif($env:DC -eq "ldc"){ - $env:DC = "ldmd2"; - $env:DMD = "ldmd2"; - $urls = ResolveLDC; - } - echo "downloading..."; - echo urls=$urls; - foreach($tryUrl in $urls){ - $dloadOk = $true; - echo Trying $tryUrl; - try{ - Invoke-WebRequest $tryUrl -OutFile "c:\compiler.archive"; - } - catch [Net.WebException]{ - $dloadOk = $false; - } - if($dloadOk -eq $true){ - break; - } - } - echo "extracting..."; - pushd c:\\; - 7z x compiler.archive > $null; - popd; - echo "finished."; - } - - ps: SetUpDCompiler - - powershell -Command Invoke-WebRequest https://code.dlang.org/files/dub-1.9.0-windows-x86.zip -OutFile dub.zip - - 7z x dub.zip -odub > nul - - set PATH=%CD%\%binpath%;%CD%\dub;%PATH% - - dub --version - # Some older LDC/GDC compilers don't come with rdmd - - ps: function SetUpRDMD - { - if((Get-Command "rdmd.exe" -ErrorAction SilentlyContinue) -eq $null) - { - Invoke-WebRequest "http://downloads.dlang.org/releases/2.x/2.080.0/dmd.2.080.0.windows.7z" -OutFile "c:\rdmd-dmd.7z"; - pushd c:\\; - 7z x -ordmd-dmd rdmd-dmd.7z > $null; - popd; - } - } - - ps: SetUpRDMD - - set PATH=%PATH%;c:\rdmd-dmd\dmd2\windows\bin - - -before_build: - - ps: if($env:arch -eq "x86"){ - $env:compilersetupargs = "x86"; - $env:Darch = "x86"; - } - elseif($env:arch -eq "x64"){ - $env:compilersetupargs = "amd64"; - $env:Darch = "x86_64"; - } - - ps : if($env:DC -eq "dmd"){ - $env:PATH += ";C:\dmd2\windows\bin;"; - } - elseif($env:DC -eq "ldc"){ - $version = $env:DVersion; - $env:PATH += ";C:\ldc2-$($version)-win64-msvc\bin"; - $env:DC = "ldc2"; - } - - call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" %arch% 8.1 - -build_script: - - dub build --arch=%Darch% --compiler=%DC% && cd example && dub build --arch=%Darch% --compiler=%DC% --config=appveyor - -#test_script: -# - echo %PLATFORM% -# - echo %Darch% -# - echo %DC% -# - echo %DMD% -# - echo %PATH% -# - '%DC% --help' -# - dub test --arch=%Darch% --compiler=%DC%