Skip to content

Commit

Permalink
CircleCI & AppVeyor: Include dub & dlang tools in package artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Dec 5, 2017
1 parent 7c7c442 commit a32770f
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 35 deletions.
31 changes: 29 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
- LLVM_VERSION: 5.0.0-2
- HOST_LDC_VERSION: 1.6.0
- EXTRA_CMAKE_FLAGS: "-DMULTILIB=ON -DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ -DLDC_INSTALL_LTOPLUGIN=ON -DLDC_INSTALL_LLVM_RUNTIME_LIBS=ON"
- DUB_VERSION: v1.6.0
steps:
- run:
name: Install dependencies
Expand All @@ -28,7 +29,7 @@ jobs:
echo "export PATH=$PWD/cmake-x64/bin:$PATH" >> $BASH_ENV
# install lit
pip install --user lit
# use ld.gold per default, so that LTO is tested.
# use ld.gold per default, so that LTO is tested
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.gold 99
- checkout
- run:
Expand Down Expand Up @@ -119,12 +120,38 @@ jobs:
command: cd ../ninja-ldc && ctest -j3 --output-on-failure -E "std\.process|dmd-testsuite|ldc2-unittest|lit-tests"
when: always
- run:
name: Install LDC & pack installation dir
name: Install LDC
command: |
cd ../ninja-ldc
ninja install
cd ..
perl -pi -e s?/root/ldc2-x64/?%%ldcbinarypath%%/../?g ldc2-x64/etc/ldc2.conf
- run:
name: Build dub
command: |
cd ..
export LDC_INSTALL_DIR=$PWD/ldc2-x64
export DMD=$LDC_INSTALL_DIR/bin/ldmd2
git clone --recursive https://github.com/dlang/dub.git
cd dub
git checkout $DUB_VERSION
./build.sh
cp bin/dub $LDC_INSTALL_DIR/bin
cd ..
- run:
name: Build dlang tools
command: |
cd ..
export LDC_INSTALL_DIR=$PWD/ldc2-x64
git clone --recursive https://github.com/dlang/tools.git
cd tools
make -f posix.mak install DMD=$LDC_INSTALL_DIR/bin/ldmd2 INSTALL_DIR=$PWD
cp bin/rdmd bin/ddemangle bin/dustmite $LDC_INSTALL_DIR/bin
cd ..
- run:
name: Pack installation dir
command: |
cd ..
mkdir artifacts
export artifactBasename="ldc2-${CIRCLE_SHA1:0:8}-linux-x86_64-$(date "+%Y%m%d")"
mv ldc2-x64 $artifactBasename
Expand Down
95 changes: 62 additions & 33 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ install:
- cd libcurl
- 7z x ..\libcurl.zip > nul
- cd ..
# Copy libcurl.dll to final LDC installation directory and add to PATH
- md ldc2-%APPVEYOR_JOB_ARCH% && md ldc2-%APPVEYOR_JOB_ARCH%\bin
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( copy libcurl\dmd2\windows\bin64\libcurl.dll ldc2-x64\bin )
- if "%APPVEYOR_JOB_ARCH%"=="x86" ( copy libcurl\dmd2\windows\bin\libcurl.dll ldc2-x86\bin )
# Copy libcurl.{dll,lib} to final LDC installation directory and add to PATH
- md ldc2-%APPVEYOR_JOB_ARCH% && md ldc2-%APPVEYOR_JOB_ARCH%\bin && md ldc2-%APPVEYOR_JOB_ARCH%\lib
- ps: |
If ($Env:APPVEYOR_JOB_ARCH -eq 'x64') {
cp libcurl\dmd2\windows\bin64\libcurl.dll ldc2-x64\bin
cp libcurl\dmd2\windows\lib64\curl.lib ldc2-x64\lib
} Else {
cp libcurl\dmd2\windows\bin\libcurl.dll ldc2-x86\bin
cp libcurl\dmd2\windows\lib32mscoff\curl.lib ldc2-x86\lib
}
- set PATH=%CD%\ldc2-%APPVEYOR_JOB_ARCH%\bin;%PATH%
# Download & extract Ninja
- appveyor DownloadFile "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip" -FileName ninja.zip
Expand Down Expand Up @@ -107,14 +113,59 @@ build_script:
# Build LDC and stdlib unittest runners
- ninja -j2 all all-test-runners

after_build:
# Install LDC, pack & publish as artifact
#---------------------------------#
# test configuration #
#---------------------------------#

test_script:
- cd c:\projects\ninja-ldc
- bin\ldc2 -version
# Build and run LDC D unittests
- ctest --output-on-failure -R "ldc2-unittest"
# Run LIT testsuite
- ctest -V -R "lit-tests"
# Run DMD testsuite
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( set OS=Win_64) else ( set OS=Win_32)
- set DMD_TESTSUITE_MAKE_ARGS=-j2
- ctest -V -R "dmd-testsuite"
# Run stdlib unittests
- ctest -j2 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"

#---------------------------------#
# deployment configuration #
#---------------------------------#

after_test:
# Install LDC
- ps: |
echo 'Preparing artifact...'
cd c:\projects\ninja-ldc
ninja install > $null
cd "..\ldc2-$Env:APPVEYOR_JOB_ARCH"
(gc etc\ldc2.conf).replace("C:/projects/ldc2-$Env:APPVEYOR_JOB_ARCH/", '%%ldcbinarypath%%/../') | sc etc\ldc2.conf
(cat etc\ldc2.conf).replace("C:/projects/ldc2-$Env:APPVEYOR_JOB_ARCH/", '%%ldcbinarypath%%/../') | Set-Content etc\ldc2.conf
# Build dub
- ps: |
cd c:\projects
$ldcInstallDir = "c:\projects\ldc2-$Env:APPVEYOR_JOB_ARCH"
Set-Item -path env:DC -value "$ldcInstallDir\bin\ldmd2"
git clone --recursive https://github.com/dlang/dub.git
cd dub
git checkout v1.6.0
(cat build.cmd).replace('curl.lib', "$ldcInstallDir\lib\curl.lib") | Set-Content build.cmd
.\build.cmd
cp bin\dub.exe "$ldcInstallDir\bin"
# Build dlang tools
- ps: |
cd c:\projects
$ldcInstallDir = "c:\projects\ldc2-$Env:APPVEYOR_JOB_ARCH"
git clone --recursive https://github.com/dlang/tools.git
cd tools
& "$ldcInstallDir\bin\ldmd2" -w rdmd.d
& "$ldcInstallDir\bin\ldmd2" -w ddemangle.d
& "$ldcInstallDir\bin\ldmd2" -w DustMite\dustmite.d DustMite\splitter.d
cp *.exe "$ldcInstallDir\bin"
# Pack installation dir & publish as artifact
- ps: |
cd "c:\projects\ldc2-$Env:APPVEYOR_JOB_ARCH"
$artifactFilename = "ldc2-$($Env:APPVEYOR_REPO_COMMIT.Substring(0, 8))-windows-$Env:APPVEYOR_JOB_ARCH.7z"
7z a "..\$artifactFilename" * > $null
cd ..
Expand Down Expand Up @@ -144,40 +195,18 @@ after_build:
ren lib lib64
copy ..\ldc2-x86\lib -Recurse
ren lib lib32
(gc etc\ldc2.conf).replace('%%ldcbinarypath%%/../lib', '%%ldcbinarypath%%/../lib64') | sc etc\ldc2.conf
$conf32 = gc ..\ldc2-x86\etc\ldc2.conf -Raw
(cat etc\ldc2.conf).replace('%%ldcbinarypath%%/../lib', '%%ldcbinarypath%%/../lib64') | Set-Content etc\ldc2.conf
$conf32 = cat ..\ldc2-x86\etc\ldc2.conf -Raw
$conf32 = "`r`ni686-pc-windows-msvc:" + $conf32.Substring($conf32.IndexOf("`r`ndefault:") + 10)
$conf32 = $conf32.Replace('%%ldcbinarypath%%/../lib', '%%ldcbinarypath%%/../lib32')
ac etc\ldc2.conf $conf32
Add-Content etc\ldc2.conf $conf32
$artifactFilename = "ldc2-$($Env:APPVEYOR_REPO_COMMIT.Substring(0, 8))-windows-multilib.7z"
7z a "..\$artifactFilename" * > $null
cd ..
Push-AppveyorArtifact $artifactFilename
}
}
#---------------------------------#
# test configuration #
#---------------------------------#

test_script:
- cd c:\projects\ninja-ldc
- bin\ldc2 -version
# Build and run LDC D unittests
- ctest --output-on-failure -R "ldc2-unittest"
# Run LIT testsuite
- ctest -V -R "lit-tests"
# Run DMD testsuite
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( set OS=Win_64) else ( set OS=Win_32)
- set DMD_TESTSUITE_MAKE_ARGS=-j2
- ctest -V -R "dmd-testsuite"
# Run stdlib unittests
- ctest -j2 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"

#---------------------------------#
# deployment configuration #
#---------------------------------#

deploy:
- provider: GitHub
release: CI
Expand Down

0 comments on commit a32770f

Please sign in to comment.