diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bd55731 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI +on: [push, pull_request] + +jobs: + Build: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + dc: + - ldc-latest + - dmd-latest + arch: + - x86_64 + include: + # windows x86 + - os: windows-latest + arch: x86 + dc: ldc-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Setup D + uses: dlang-community/setup-dlang@v1 + with: + compiler: ${{ matrix.dc }} + + - name: Build + run: | + dub build --build=release --config=client --arch=${{ matrix.arch }} + dub build --build=release --config=server --arch=${{ matrix.arch }} + + - name: Linux Tests + if: contains(matrix.os, 'ubuntu') + run: | + ./run_tests.sh + working-directory: tests + shell: bash + + - name: Windows and MacOS Tests + if: contains(matrix.os, 'windows') || contains(matrix.os, 'macos') + run: | + ./run_tests.sh + working-directory: tests + shell: bash + continue-on-error: true diff --git a/.travis.sh b/.travis.sh deleted file mode 100755 index 8c47256..0000000 --- a/.travis.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e - -if [[ $BUILD == dub ]]; then - if [[ -n $LIBDPARSE_VERSION ]]; then - rdmd ./d-test-utils/test_with_package.d $LIBDPARSE_VERSION libdparse -- dub build --build=release --config=client - rdmd ./d-test-utils/test_with_package.d $LIBDPARSE_VERSION libdparse -- dub build --build=release --config=server - elif [[ -n $DSYMBOL_VERSION ]]; then - rdmd ./d-test-utils/test_with_package.d $DSYMBOL_VERSION dsymbol -- dub build --build=release --config=client - rdmd ./d-test-utils/test_with_package.d $DSYMBOL_VERSION dsymbol -- dub build --build=release --config=server - else - echo 'Cannot run test without LIBDPARSE_VERSION nor DSYMBOL_VERSION environment variable' - exit 1 - fi -elif [[ $DC == ldc2 ]]; then - git submodule update --init --recursive - make ldc -j2 -else - git submodule update --init --recursive - make debug -j2 -fi - -cd tests && ./run_tests.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 26321bc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,95 +0,0 @@ -dist: xenial -language: d - -d: - - dmd - - ldc-beta - - ldc - -os: - - linux -# TODO, some bug in OSX for the server that causes it to fail -# - osx - -env: - - BUILD= - - BUILD=dub LIBDPARSE_VERSION=min - - BUILD=dub LIBDPARSE_VERSION=max - - BUILD=dub DSYMBOL_VERSION=min - - BUILD=dub DSYMBOL_VERSION=max - -branches: - only: - - master - - /^v\d+\.\d+\.\d+([+-]\S*)*$/ - -script: ./.travis.sh -jobs: - include: - - stage: GitHub Release - #if: tag IS present - d: ldc-1.23.0 - os: linux - script: echo "Deploying to GitHub releases ..." && ./release.sh - deploy: - provider: releases - api_key: $GH_REPO_TOKEN - file_glob: true - file: bin/dcd-*.tar.gz - skip_cleanup: true - on: - repo: dlang-community/DCD - tags: true - - stage: GitHub Release - #if: tag IS present - d: ldc-1.23.0 - os: osx - script: echo "Deploying to GitHub releases ..." && ./release.sh - deploy: - provider: releases - api_key: $GH_REPO_TOKEN - file_glob: true - file: bin/dcd-*.tar.gz - skip_cleanup: true - on: - repo: dlang-community/DCD - tags: true - - stage: GitHub Release - #if: tag IS present - d: ldc-1.23.0 - os: linux - script: echo "Deploying to GitHub releases ..." && ./release-windows.sh - addons: - apt: - packages: - - p7zip-full - deploy: - provider: releases - api_key: $GH_REPO_TOKEN - file_glob: true - file: bin/dcd-*.zip - skip_cleanup: true - on: - repo: dlang-community/DCD - tags: true - - stage: GitHub Release - #if: tag IS present - d: ldc-1.23.0 - os: linux - script: echo "Deploying to GitHub releases ..." && ARCH=64 ./release-windows.sh - addons: - apt: - packages: - - p7zip-full - deploy: - provider: releases - api_key: $GH_REPO_TOKEN - file_glob: true - file: bin/dcd-*.zip - skip_cleanup: true - on: - repo: dlang-community/DCD - tags: true -stages: - - name: test - if: type = pull_request or (type = push and branch = master) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 9a3a11e..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,112 +0,0 @@ -platform: x64 -environment: - matrix: - - DC: dmd - DVersion: stable - arch: x64 - - DC: dmd - DVersion: stable - arch: x86 - # - DC: ldc - # DVersion: beta - # arch: x86 - # - DC: ldc - # DVersion: beta - # arch: x64 - # - DC: ldc - # DVersion: stable - # arch: x86 - # - DC: ldc - # DVersion: stable - # arch: x64 - -skip_tags: false -branches: - only: - - master - - /^v\d+\.\d+\.\d+([+-]\S*)*$/ - -install: - - ps: function ResolveLatestDMD - { - $version = $env:DVersion; - if($version -eq "stable") { - $latest = (Invoke-WebRequest "http://downloads.dlang.org/releases/LATEST").toString(); - $url = "http://downloads.dlang.org/releases/2.x/$($latest)/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]; - $url = "http://downloads.dlang.org/pre-releases/2.x/$($latestVersion)/dmd.$($latest).windows.7z"; - }elseif($version -eq "nightly") { - $url = "http://nightlies.dlang.org/dmd-master-2017-05-20/dmd.master.windows.7z" - }else { - $url = "http://downloads.dlang.org/releases/2.x/$($version)/dmd.$($version).windows.7z"; - } - $env:PATH += ";C:\dmd2\windows\bin;"; - return $url; - } - - ps: function ResolveLatestLDC - { - $version = $env:DVersion; - if($version -eq "stable") { - $latest = (Invoke-WebRequest "https://ldc-developers.github.io/LATEST").toString().replace("`n","").replace("`r",""); - $url = "https://github.com/ldc-developers/ldc/releases/download/v$($latest)/ldc2-$($latest)-win64-msvc.zip"; - }elseif($version -eq "beta") { - $latest = (Invoke-WebRequest "https://ldc-developers.github.io/LATEST_BETA").toString().replace("`n","").replace("`r",""); - $url = "https://github.com/ldc-developers/ldc/releases/download/v$($latest)/ldc2-$($latest)-win64-msvc.zip"; - } else { - $latest = $version; - $url = "https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-win64-msvc.zip"; - } - $env:PATH += ";C:\ldc2-$($latest)-win64-msvc\bin"; - $env:DC = "ldc2"; - return $url; - } - - ps: function SetUpDCompiler - { - $env:toolchain = "msvc"; - if($env:DC -eq "dmd"){ - echo "downloading ..."; - $url = ResolveLatestDMD; - echo $url; - Invoke-WebRequest $url -OutFile "c:\dmd.7z"; - echo "finished."; - pushd c:\\; - 7z x dmd.7z > $null; - popd; - } - elseif($env:DC -eq "ldc"){ - echo "downloading ..."; - $url = ResolveLatestLDC; - echo $url; - Invoke-WebRequest $url -OutFile "c:\ldc.zip"; - echo "finished."; - pushd c:\\; - 7z x ldc.zip > $null; - popd; - } - } - - ps: SetUpDCompiler - -build_script: - - ps: if($env:arch -eq "x86"){ - $env:compilersetupargs = "x86"; - $env:Darch = "x86"; - $env:DConf = "m32"; - }elseif($env:arch -eq "x64"){ - $env:compilersetupargs = "amd64"; - $env:Darch = "x86_64"; - $env:DConf = "m64"; - } - - ps: $env:compilersetup = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall"; - - '"%compilersetup%" %compilersetupargs%' - -test_script: - - echo %PLATFORM% - - echo %Darch% - - echo %DC% - - echo %PATH% - - '%DC% --version' - - dub test --arch=%Darch% --compiler=%DC% - - git submodule update --init --recursive - - build.bat