Skip to content

Commit

Permalink
Test the whole of vibe-d as part of the CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Feb 9, 2024
1 parent f4dba78 commit 1f8b475
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 35 deletions.
101 changes: 66 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,71 @@
name: Run all D Tests
name: CI

# Only triggers on pushes/PRs to master
on:
pull_request:
branches:
- master
push:
branches:
- master
- github_actions
pull_request:
branches:
- master
push:
branches:
- master
- 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
environment:
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, windows-latest, macOS-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
environment:
ARCH: ${{matrix.arch}}
TESTS: ${{matrix.tests}}
run: ./test.sh
shell: bash
35 changes: 35 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/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
git clone https://github.com/vibe-d/vibe-core.git --depth 1
dub add-local .
cd vibe-core
dub test
cd ..

git clone https://github.com/vibe-d/vibe.d.git --depth 1
cd vibe.d
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 1f8b475

Please sign in to comment.