Update CI #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
#schedule: | |
# - cron: '40 7 1 * *' | |
push: | |
pull_request: | |
jobs: | |
builds: | |
name: ${{ matrix.compiler }} on ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest] | |
compiler: | |
- dmd-latest | |
- ldc-latest | |
- dmd-2.106.1 # (released in 2024) | |
- dmd-2.105.3 # (released in 2023) | |
- dmd-2.104.2 # (released in 2023) | |
- dmd-2.103.1 # (released in 2023) | |
- dmd-2.102.2 # (released in 2023) | |
- dmd-2.101.2 # (released in 2023) | |
- dmd-2.100.2 # (released in 2022) ## GDC 12 can support 2.100 | |
- dmd-2.099.1 # (released in 2022) | |
- dmd-2.098.1 # (released in 2021) ## Has issue re: phobos/std/variant.d (exclude on Windows) | |
- dmd-2.097.2 # (released in 2021) (exclude on Windows) | |
- ldc-1.33.0 # eq to dmd v2.103.1 | |
- ldc-1.32.2 # eq to dmd v2.102.2 | |
- ldc-1.29.0 # eq to dmd v2.099.1 | |
- ldc-1.28.1 # eq to dmd v2.098.1 (exclude on Windows) | |
- ldc-1.27.1 # eq to dmd v2.097.2 (exclude on Windows) | |
include: | |
- { os: macos-latest, compiler: dmd-latest } | |
- { os: macos-latest, compiler: ldc-latest } | |
- { os: 'ubuntu-latest', compiler: 'ldc-1.28.1' } | |
- { os: 'ubuntu-latest', compiler: 'ldc-1.27.1' } | |
exclude: | |
- { os: windows-latest, compiler: dmd-2.098.1 } | |
- { os: windows-latest, compiler: dmd-2.097.2 } | |
- { os: windows-latest, compiler: ldc-1.28.1 } | |
- { os: windows-latest, compiler: ldc-1.27.1 } | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install D compiler | |
uses: dlang-community/setup-dlang@v1 | |
with: | |
compiler: ${{ matrix.compiler }} | |
- name: Install dependencies on Ubuntu | |
if: startsWith(matrix.os, 'ubuntu') | |
run: sudo apt-get update && sudo apt-get install libev-dev libpq-dev libevent-dev libsqlite3-dev -y | |
# - name: Install dependencies on Mac OSX | |
# if: startsWith(matrix.os, 'mac') | |
# run: brew bundle | |
- name: build with SQLite config | |
run: dub build --config=SQLite | |
build-examples: | |
name: Test ${{ matrix.compiler }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
compiler: | |
- dmd-latest | |
- ldc-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install D ${{ matrix.compiler }} | |
uses: dlang-community/setup-dlang@v1 | |
with: | |
compiler: ${{ matrix.compiler }} | |
- name: Install dependencies on Ubuntu | |
if: startsWith(matrix.os, 'ubuntu') | |
run: sudo apt-get update && sudo apt-get install libev-dev libpq-dev libevent-dev libsqlite3-dev -y | |
- name: Install dependencies on Mac OSX | |
if: startsWith(matrix.os, 'macos') | |
run: brew bundle | |
- name: Run example 1 | |
if: ${{ !(startsWith(matrix.os, 'windows') && startsWith(matrix.compiler, 'ldc')) }} | |
working-directory: examples/example1 | |
run: dub | |
integration-tests: | |
name: Integration Tests | |
runs-on: ubuntu-20.04 | |
services: | |
mysql: | |
image: mysql:5.7 | |
ports: [3306] | |
env: | |
MYSQL_ROOT_PASSWORD: f48dfhw3Hd!Asah7i2aZ | |
MYSQL_DATABASE: hdtest | |
MYSQL_USER: testuser | |
MYSQL_PASSWORD: passw0rd | |
# Set health checks to wait until mysql service has started | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 3s | |
--health-retries 4 | |
postgres: | |
image: postgres | |
ports: [5432] | |
env: | |
POSTGRES_DB: hdtest | |
POSTGRES_USER: testuser | |
POSTGRES_PASSWORD: passw0rd | |
# Set health checks to wait until postgres service has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 3s | |
--health-retries 3 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install latest DMD | |
uses: dlang-community/setup-dlang@v1 | |
with: | |
compiler: dmd-latest | |
- name: HD Test (SQLite) | |
working-directory: ./hdtest | |
run: | | |
dub build --config=SQLite && ./bin/hdtest | |
- name: HD Test (MySQL) | |
working-directory: ./hdtest | |
env: | |
PORT: ${{ job.services.mysql.ports[3306] }} | |
run: | | |
dub build --config=MySQL && ./bin/hdtest --host=127.0.0.1 --port=$PORT --database=hdtest --user=testuser --password=passw0rd | |
- name: HD Test (Postgres) | |
working-directory: ./hdtest | |
env: | |
PORT: ${{ job.services.postgres.ports[5432] }} | |
run: | | |
dub build --config=PGSQL && ./bin/hdtest --host=127.0.0.1 --port=$PORT --database=hdtest --user=testuser --password=passw0rd | |