-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (47 loc) · 1.32 KB
/
ci.yml
File metadata and controls
59 lines (47 loc) · 1.32 KB
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
name: CI
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
jobs:
test:
name: Run Tests
runs-on: self-hosted
strategy:
matrix:
dc: [ldc-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}
- name: Print D compiler version
run: |
ldc2 --version || true
dub --version
- name: Cache DUB dependencies
uses: actions/cache@v3
with:
path: ~/.dub
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json', '**/dub.selections.json') }}
restore-keys: |
${{ runner.os }}-dub-
- name: Install dependencies
run: dub upgrade
- name: Build project (debug)
run: dub build --build=debug
- name: Build project (release)
run: dub build --build=release-fast
- name: Run unit tests
run: |
echo "=== Executando Unit Tests ==="
dub build --config=unittest --build=unittest
dub run --config=unittest --build=unittest
- name: Build with different compilers (if matrix)
run: |
echo "=== Testing with ${{ matrix.dc }} ==="
dub --version
dub build --compiler=${{ matrix.dc }} || dub build