Merge pull request #164 from vibe-d/github_actions
Add initial GitHub actions based CI recipe.
This commit is contained in:
commit
1e5f3f04ce
42
.github/workflows/ci.yml
vendored
Normal file
42
.github/workflows/ci.yml
vendored
Normal 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
|
|
@ -25,7 +25,7 @@ version (Windows) {
|
||||||
int close(int fd) @safe;
|
int close(int fd) @safe;
|
||||||
int read(int fd, void *buffer, uint count);
|
int read(int fd, void *buffer, uint count);
|
||||||
int write(int fd, in 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;
|
enum O_RDONLY = 0;
|
||||||
|
@ -46,6 +46,11 @@ else
|
||||||
enum O_BINARY = 0;
|
enum O_BINARY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
version (darwin) {
|
||||||
|
// NOTE: Always building for 64-bit, so these are identical
|
||||||
|
alias lseek64 = lseek;
|
||||||
|
}
|
||||||
|
|
||||||
private {
|
private {
|
||||||
enum SEEK_SET = 0;
|
enum SEEK_SET = 0;
|
||||||
enum SEEK_CUR = 1;
|
enum SEEK_CUR = 1;
|
||||||
|
@ -197,7 +202,9 @@ final class ThreadedFileEventDriver(Events : EventDriverEvents) : EventDriverFil
|
||||||
|
|
||||||
version (linux) {
|
version (linux) {
|
||||||
// stat_t seems to be defined wrong on linux/64
|
// 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 {
|
} else {
|
||||||
stat_t st;
|
stat_t st;
|
||||||
() @trusted { fstat(cast(int)file, &st); } ();
|
() @trusted { fstat(cast(int)file, &st); } ();
|
||||||
|
@ -361,9 +368,8 @@ log("start processing");
|
||||||
|
|
||||||
auto bytes = buffer;
|
auto bytes = buffer;
|
||||||
version (Windows) {
|
version (Windows) {
|
||||||
assert(offset <= off_t.max);
|
._lseeki64(cast(int)file, offset, SEEK_SET);
|
||||||
.lseek(cast(int)file, cast(off_t)offset, SEEK_SET);
|
} else .lseek64(cast(int)file, offset, SEEK_SET);
|
||||||
} else .lseek(cast(int)file, offset, SEEK_SET);
|
|
||||||
|
|
||||||
scope (exit) {
|
scope (exit) {
|
||||||
log("trigger event");
|
log("trigger event");
|
||||||
|
|
|
@ -6,8 +6,8 @@ set -e -x -o pipefail
|
||||||
dub build -b release --compiler=$DC -c $CONFIG
|
dub build -b release --compiler=$DC -c $CONFIG
|
||||||
|
|
||||||
# test for successful 32-bit build
|
# test for successful 32-bit build
|
||||||
if [ "$DC" == "dmd" ]; then
|
if [ "$DC" == "ldc2" ]; then
|
||||||
dub build --arch=x86 -c $CONFIG
|
dub build --arch=x86 --compiler=ldc2 -c $CONFIG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dub test --compiler=$DC -c $CONFIG
|
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
|
dub build --compiler=$DC --override-config eventcore/$CONFIG --single $ex
|
||||||
done
|
done
|
||||||
rm -rf examples/.dub/
|
rm -rf examples/.dub/
|
||||||
rm examples/*-example
|
rm -f examples/*-example
|
||||||
|
rm -f examples/*-example.exe
|
||||||
fi
|
fi
|
||||||
if [ ${RUN_TEST=1} -eq 1 ]; then
|
if [ ${RUN_TEST=1} -eq 1 ]; then
|
||||||
for ex in `\ls -1 tests/*.d`; do
|
for ex in `\ls -1 tests/*.d`; do
|
||||||
|
|
Loading…
Reference in a new issue