Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI + Use GitHub Actions to run the tests on Windows #287

Merged
merged 6 commits into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 36 additions & 16 deletions .github/workflows/d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,64 @@ on: [push, pull_request]

jobs:
test:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
atilaneves marked this conversation as resolved.
Show resolved Hide resolved
name: Dub Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-20.04, windows-latest]
dc:
- dmd-2.096.1
- dmd-2.095.0
- ldc-1.26.0
- ldc-1.20.0

arch:
- x86_64
clang:
- 10
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Install package dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq libclang-10-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3
bundler-cache: true

- uses: actions/setup-ruby@v1
# Ruby puts this on the path which breaks ldc
- name: Rename msys64/link.exe
if: startsWith(matrix.os,'windows')
shell: pwsh
run: mv C:\msys64\usr\bin\link.exe C:\msys64\usr\bin\msys-link.exe

- run: gem install bundler -v 1.17.3
- name: Setup D
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}

- run: bundle install
- name: Setup Visual Studio Command Prompt - Windows
if: startsWith(matrix.os,'windows')
uses: ilammy/msvc-dev-cmd@v1

- name: Install D compiler
uses: dlang-community/setup-dlang@v1.0.5
# NOTE use KyleMayes/install-llvm-action once https://github.com/KyleMayes/install-llvm-action/pull/11 is merged
- name: Setup LLVM
uses: aminya/install-llvm-action@default-directory
with:
compiler: ${{ matrix.dc }}
version: ${{ matrix.clang }}

- name: Linux - link libclang.so
if: contains(matrix.os, 'ubuntu')
run: sudo ln -s libclang-${{ matrix.clang }}.so.1 /lib/x86_64-linux-gnu/libclang.so
working-directory: ${{ env.LLVM_PATH }}/lib

- name: Run tests
run: dub test -q --build=unittest-cov
run: dub test -q --build=unittest-cov --arch=${{ matrix.arch }}
env:
LIBRARY_PATH: /usr/lib/llvm-10/lib
LIBRARY_PATH: "${{ env.LLVM_PATH }}/lib"

- name: Build binary
run: dub build -q
run: dub build -q --arch=${{ matrix.arch }}
env:
LIBRARY_PATH: /usr/lib/llvm-10/lib
LIBRARY_PATH: "${{ env.LLVM_PATH }}/lib"

- uses: codecov/codecov-action@v1
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'

gem 'aruba', '~> 0.6.2'
gem 'cucumber', '~>2.0.0'
gem 'aruba', '1.1.1'
gem 'cucumber', '6.1.0'
39 changes: 0 additions & 39 deletions Gemfile.lock

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
d++ - #include C and C++ headers in D files
====================================================

[![Build Status](https://travis-ci.org/atilaneves/dpp.png?branch=master)](https://travis-ci.org/atilaneves/dpp)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/atilaneves/dpp?branch=master&svg=true)](https://ci.appveyor.com/project/atilaneves/dpp)
[![CI](https://github.com/atilaneves/dpp/actions/workflows/d.yml/badge.svg)](https://github.com/atilaneves/dpp/actions/workflows/d.yml)
[![Coverage](https://codecov.io/gh/atilaneves/dpp/branch/master/graph/badge.svg)](https://codecov.io/gh/atilaneves/dpp)
[![Open on run.dlang.io](https://img.shields.io/badge/run.dlang.io-open-blue.svg)](https://run.dlang.io/is/JK0CAf)

Expand Down
80 changes: 4 additions & 76 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,5 @@
platform: x64
atilaneves marked this conversation as resolved.
Show resolved Hide resolved
environment:
matrix:
- DC: dmd
DVersion: 2.095.0
arch: x64
build: off

skip_tags: true

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;
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;
}
}
- ps: SetUpDCompiler

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";
}
- ps: $env:compilersetup = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall";
- '"%compilersetup%" %compilersetupargs%'

build_script:
- echo dummy build script - dont remove me

test_script:
- echo %PLATFORM%
- echo %Darch%
- echo %DC%
- echo %PATH%
- '%DC% --version'
- dub test --arch=%Darch% --registry=http://31.15.67.41
branches:
only:
- non-existing