Skip to content

Commit

Permalink
Merge pull request #3 from vibe-d/test_vibe_d
Browse files Browse the repository at this point in the history
Test the whole of vibe-d as part of the CI
  • Loading branch information
l-kramer authored Feb 9, 2024
2 parents f4dba78 + c24f3a5 commit 2df0ff7
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 28 deletions.
87 changes: 59 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run all D Tests
name: CI

# Only triggers on pushes/PRs to master
on:
Expand All @@ -11,30 +11,61 @@ on:
- github_actions

jobs:
test:
name: Dub Tests
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dc: [dmd-latest, ldc-latest]
arch: [x86_64]
include:
- { os: windows-latest, dc: dmd-2.092.0, arch: x86_64 }
- { os: windows-latest, dc: dmd-2.092.0, arch: x86_mscoff }
- { os: windows-latest, dc: dmd-2.091.1, arch: x86_64 }
- { os: windows-latest, dc: ldc-1.20.1, arch: x86_64 }

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Install D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}

- name: Run tests
run: dub test -a ${{matrix.arch}}
shell: bash
test:
name: Unittests
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dc: [dmd-latest, ldc-latest]
arch: [x86_64]
tests: [unittests]
include:
- { os: windows-latest, dc: dmd-2.092.0, arch: x86_64, tests: unittests }
- { os: windows-latest, dc: dmd-2.092.0, arch: x86_mscoff, tests: unittests }
- { os: windows-latest, dc: dmd-2.091.1, arch: x86_64, tests: unittests }
- { os: windows-latest, dc: ldc-1.20.1, arch: x86_64, tests: unittests }

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Install D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}

- name: Run tests
env:
ARCH: ${{matrix.arch}}
TESTS: ${{matrix.tests}}
run: ./test.sh
shell: bash

vibe-d:
name: vibe.d
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
dc: [dmd-latest, ldc-latest]
arch: [x86_64]
tests: [vibe-d]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Install D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}

- name: Run tests
env:
ARCH: ${{matrix.arch}}
TESTS: ${{matrix.tests}}
run: ./test.sh
shell: bash
43 changes: 43 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

set -e -x -o pipefail

DUB_ARGS="--compiler $DC -a $ARCH"
# default to run all parts
: ${TESTS:=unittests,vibe-d}

if [[ $TESTS =~ (^|,)unittests(,|$) ]]; then
dub test $DUB_ARGS
fi

if [[ $TESTS =~ (^|,)vibe-d(,|$) ]]; then
PATH_ESCAPED=$(echo `pwd` | sed 's_/_\\/_g')
SED_EXPR='s/"vibe-container": [^,]*(,?)/"vibe-container": \{"path": "'$PATH_ESCAPED'"\}\1/g'

git clone https://github.com/vibe-d/vibe-core.git --depth 1
cd vibe-core
dub upgrade -s
sed -i -E "$SED_EXPR" dub.selections.json
dub test
cd ..

git clone https://github.com/vibe-d/vibe.d.git --depth 1
cd vibe.d
dub upgrade -s
for i in `find | grep dub.selections.json`; do
sed -i -E "$SED_EXPR" $i
done
dub test :data $DUB_ARGS
dub test :mongodb $DUB_ARGS
dub test :redis $DUB_ARGS
dub test :web $DUB_ARGS
dub test :utils $DUB_ARGS
dub test :http $DUB_ARGS
dub test :mail $DUB_ARGS
dub test :stream $DUB_ARGS
dub test :crypto $DUB_ARGS
dub test :tls $DUB_ARGS
dub test :textfilter $DUB_ARGS
dub test :inet $DUB_ARGS
cd ..
fi

0 comments on commit 2df0ff7

Please sign in to comment.