-
Notifications
You must be signed in to change notification settings - Fork 6
155 lines (149 loc) · 5.07 KB
/
ci.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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
# allow this workflow to be triggered manually
jobs:
asan:
name: '[ubuntu] ASan x86_64/ldc-latest'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- name: Set up D compiler / tools
uses: dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
with:
compiler: ldc-latest
- name: Cache dub dependencies
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ~/.dub/packages
key: ubuntu-latest-build-${{ hashFiles('**/dub.sdl', '**/dub.json') }}
restore-keys: |
ubuntu-latest-build-
- name: Run unittests
run: |
dub test -b asan-unittest --compiler=ldc2
setup:
name: 'Load job configuration'
runs-on: ubuntu-latest
outputs:
compilers: ${{ steps.load-config.outputs.compilers }}
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- id: load-config
run: |
echo "::set-output name=compilers::$(cat .github/workflows/compilers.json | jq -c -M)"
macos:
name: '[macos] x86_64/${{ matrix.dc }}'
runs-on: macos-latest
needs: setup
continue-on-error: ${{ contains(matrix.dc, 'beta') || contains(matrix.dc, 'master') }}
env:
ARCH: x86_64
strategy:
fail-fast: false
matrix:
dc: ${{ fromJSON(needs.setup.outputs.compilers) }}
steps:
- name: Checkout repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
fetch-depth: 0
- name: Setup D compiler
uses: dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
with:
compiler: ${{ matrix.dc }}
- name: Cache dub dependencies
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ~/.dub/packages
key: macos-latest-build-${{ hashFiles('**/dub.sdl', '**/dub.json') }}
restore-keys: |
macos-latest-build-
- name: Build / test
run: dub test --arch=$ARCH --build=unittest
shell: bash
- name: Upload coverage data
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b
ubuntu:
name: '[ubuntu] ${{ matrix.arch }}/${{ matrix.dc }}'
runs-on: ubuntu-latest
needs: setup
continue-on-error: ${{ contains(matrix.dc, 'beta') || contains(matrix.dc, 'master') }}
env:
ARCH: ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
dc: ${{ fromJSON(needs.setup.outputs.compilers) }}
arch: [x86, x86_64]
steps:
- name: Checkout repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
fetch-depth: 0
- name: Setup D compiler
uses: dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
with:
compiler: ${{ matrix.dc }}
- name: Install multi-lib for 32-bit systems
if: matrix.arch == 'x86'
run: sudo apt-get update && sudo apt-get install gcc-multilib
- name: Cache dub dependencies
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ~/.dub/packages
key: ubuntu-latest-build-${{ hashFiles('**/dub.sdl', '**/dub.json') }}
restore-keys: |
ubuntu-latest-build-
- name: Build / test
run: |
dub test --arch=$ARCH --build=unittest
shell: bash
- name: Build / test (Release mode)
if: ${{ contains(matrix.dc, 'ldc') }}
run: |
dub test --arch=$ARCH --build=unittest-release
shell: bash
- name: Upload coverage data
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b
windows:
name: '[windows] x86_64/${{ matrix.dc }}'
runs-on: windows-latest
needs: setup
continue-on-error: ${{ contains(matrix.dc, 'beta') || contains(matrix.dc, 'master') }}
env:
ARCH: x86_64
strategy:
fail-fast: false
matrix:
dc: ${{ fromJSON(needs.setup.outputs.compilers) }}
steps:
- name: Checkout repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
fetch-depth: 0
- name: Setup D compiler
uses: dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
with:
compiler: ${{ matrix.dc }}
- name: Cache dub dependencies
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ~\AppData\Local\dub
key: windows-latest-build-${{ hashFiles('**/dub.sdl', '**/dub.json') }}
restore-keys: |
windows-latest-build-
- name: Build / test
run: |
dub test --arch=$ARCH --build=unittest-dip1000
dub test --arch=$ARCH --build=unittest
shell: bash
- name: Upload coverage data
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b