Add initial GitHub actions + replace AppVeyor

This commit is contained in:
Sebastian Wilzbach 2020-09-18 12:30:01 +02:00
parent bc7521ed1f
commit 86e08b1334
2 changed files with 43 additions and 129 deletions

43
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,43 @@
name: Run all D Tests
# Only triggers on pushes/PRs to master
on:
pull_request:
branches:
- master
push:
branches:
- master
- github_actions
jobs:
test:
name: Dub Tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dc: [dmd-latest, ldc-latest]
arch: [x86_64]
include:
- { os: windows-latest, dc: dmd-2.092.0, arch: x86_64 }
- { os: windows-latest, dc: dmd-2.092.0, arch: x86 }
- { os: windows-latest, dc: dmd-2.092.0, arch: x86_mscoff }
- { os: windows-latest, dc: dmd-2.091.1, arch: x86_64 }
- { os: windows-latest, dc: dmd-2.086.1, arch: x86_64 }
- { os: windows-latest, dc: dmd-2.085.1, arch: x86_64 }
- { os: windows-latest, dc: dmd-2.079.0, arch: x86_mscoff }
- { os: windows-latest, dc: ldc-1.20.1, arch: x86_64 }
- { os: windows-latest, dc: ldc-1.16.0, arch: x86_64 }
- { os: windows-latest, dc: ldc-1.15.0, arch: x86_64 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}
- name: Run tests
run: dub test --arch ${{ matrix.arch }}

View file

@ -1,129 +0,0 @@
platform: x64
environment:
matrix:
- DC: dmd
DVersion: 2.092.0
arch: x64
- DC: dmd
DVersion: 2.092.0
arch: x86
- DC: dmd
DVersion: 2.092.0
arch: x86_mscoff
- DC: dmd
DVersion: 2.091.1
arch: x64
- DC: dmd
DVersion: 2.086.1
arch: x64
- DC: dmd
DVersion: 2.085.1
arch: x64
- DC: dmd
DVersion: 2.079.0
arch: x86_mscoff
- DC: ldc
DVersion: 1.21.0
arch: x64
- DC: ldc
DVersion: 1.20.1
arch: x64
- DC: ldc
DVersion: 1.16.0
arch: x64
- DC: ldc
DVersion: 1.15.0
arch: x64
skip_tags: false
install:
- ps: function SetUpDCompiler
{
if($env:DC -eq "dmd"){
if($env:arch -eq "x86"){
$env:DConf = "m32";
}
elseif($env:arch -eq "x64"){
$env:DConf = "m64";
}
echo "downloading ...";
$env:toolchain = "msvc";
$version = $env:DVersion;
Invoke-WebRequest "http://downloads.dlang.org/releases/2.x/$($version)/dmd.$($version).windows.7z" -OutFile "c:\dmd.7z";
echo "finished.";
pushd c:\\;
7z x dmd.7z > $null;
popd;
}
elseif($env:DC -eq "ldc"){
echo "downloading ...";
if($env:arch -eq "x86"){
$env:DConf = "m32";
}
elseif($env:arch -eq "x64"){
$env:DConf = "m64";
}
$env:toolchain = "msvc";
$version = $env:DVersion;
if ([System.Version]$version -lt [System.Version]"1.7.0") {
Invoke-WebRequest "https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-win64-msvc.zip" -OutFile "c:\ldc.zip";
echo "finished.";
pushd c:\\;
7z x ldc.zip > $null;
popd;
}
else {
Invoke-WebRequest "https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-windows-multilib.7z" -OutFile "c:\ldc.7z";
echo "finished.";
pushd c:\\;
7z x ldc.7z > $null;
popd;
}
}
}
- ps: SetUpDCompiler
- powershell -Command [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest "https://github.com/dlang/dub/releases/download/v1.7.2/dub-1.7.2-windows-x86.zip" -OutFile dub.zip
- 7z x dub.zip -odub > nul
- set PATH=%CD%\%binpath%;%CD%\dub;%PATH%
- dub --version
before_build:
- ps: if($env:arch -eq "x86"){
$env:compilersetupargs = "x86";
$env:Darch = "x86";
}
elseif($env:arch -eq "x86_mscoff"){
$env:compilersetupargs = "x86";
$env:Darch = "x86_mscoff";
}
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;
if ([System.Version]$version -lt [System.Version]"1.7.0") {
$env:PATH += ";C:\ldc2-$($version)-win64-msvc\bin";
} else {
$env:PATH += ";C:\ldc2-$($version)-windows-multilib\bin";
}
$env:DC = "ldc2";
}
- ps: $env:compilersetup = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall";
- '"%compilersetup%" %compilersetupargs%'
build_script:
- dub build -b release --arch=%Darch% --compiler=%DC%
- echo dummy build script - dont remove me
test_script:
- echo %PLATFORM%
- echo %Darch%
- echo %DC%
- echo %PATH%
- '%DC% --version'
- dub test --arch=%Darch% --compiler=%DC%