-
Notifications
You must be signed in to change notification settings - Fork 31
157 lines (136 loc) · 4.99 KB
/
dub.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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.107.1 # (released in 2024)
- 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-13, compiler: dmd-latest } ## Cannot use dmd on Apple silicon (latest is 14 with M1 cpu)
- { 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-13 ]
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