Merge pull request #164 from vibe-d/github_actions

Add initial GitHub actions based CI recipe.
This commit is contained in:
Sönke Ludwig 2020-11-26 09:47:38 +01:00 committed by GitHub
commit 1e5f3f04ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 8 deletions

42
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,42 @@
name: Test Suite
# Only triggers on pushes/PRs to master
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test:
name: CI
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dc: [dmd-latest, ldc-latest]
arch: [x86_64]
config: [select, epoll, cfrunloop, winapi]
exclude:
- {os: ubuntu-latest, config: cfrunloop}
- {os: ubuntu-latest, config: winapi}
- {os: macOS-latest, config: epoll}
- {os: macOS-latest, config: winapi}
- {os: windows-latest, config: cfrunloop}
- {os: windows-latest, config: epoll}
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
env:
CONFIG: ${{matrix.config}}
shell: bash
run: ./travis-ci.sh

View file

@ -25,7 +25,7 @@ version (Windows) {
int close(int fd) @safe;
int read(int fd, void *buffer, uint count);
int write(int fd, in void *buffer, uint count);
off_t lseek(int fd, off_t offset, int whence) @safe;
long _lseeki64(int fd, long offset, int origin) @safe;
}
enum O_RDONLY = 0;
@ -46,6 +46,11 @@ else
enum O_BINARY = 0;
}
version (darwin) {
// NOTE: Always building for 64-bit, so these are identical
alias lseek64 = lseek;
}
private {
enum SEEK_SET = 0;
enum SEEK_CUR = 1;
@ -197,7 +202,9 @@ final class ThreadedFileEventDriver(Events : EventDriverEvents) : EventDriverFil
version (linux) {
// stat_t seems to be defined wrong on linux/64
return .lseek(cast(int)file, 0, SEEK_END);
return .lseek64(cast(int)file, 0, SEEK_END);
} else version (Windows) {
return _lseeki64(cast(int)file, 0, SEEK_END);
} else {
stat_t st;
() @trusted { fstat(cast(int)file, &st); } ();
@ -361,9 +368,8 @@ log("start processing");
auto bytes = buffer;
version (Windows) {
assert(offset <= off_t.max);
.lseek(cast(int)file, cast(off_t)offset, SEEK_SET);
} else .lseek(cast(int)file, offset, SEEK_SET);
._lseeki64(cast(int)file, offset, SEEK_SET);
} else .lseek64(cast(int)file, offset, SEEK_SET);
scope (exit) {
log("trigger event");

View file

@ -6,8 +6,8 @@ set -e -x -o pipefail
dub build -b release --compiler=$DC -c $CONFIG
# test for successful 32-bit build
if [ "$DC" == "dmd" ]; then
dub build --arch=x86 -c $CONFIG
if [ "$DC" == "ldc2" ]; then
dub build --arch=x86 --compiler=ldc2 -c $CONFIG
fi
dub test --compiler=$DC -c $CONFIG
@ -18,7 +18,8 @@ if [ ${BUILD_EXAMPLE=1} -eq 1 ]; then
dub build --compiler=$DC --override-config eventcore/$CONFIG --single $ex
done
rm -rf examples/.dub/
rm examples/*-example
rm -f examples/*-example
rm -f examples/*-example.exe
fi
if [ ${RUN_TEST=1} -eq 1 ]; then
for ex in `\ls -1 tests/*.d`; do