diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb1d83b..2be8d64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..2c950c8 --- /dev/null +++ b/test.sh @@ -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