-
Notifications
You must be signed in to change notification settings - Fork 18
97 lines (84 loc) · 3.17 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
# Copied from sociomantic-tsunami/ocean, keep in sync
name: CI
on: [push, pull_request]
jobs:
main:
name: Run
strategy:
# Disable `fail-fast` because even if things fail for one compiler release
# or build flavour we still want to see how things perform with the others
fail-fast: false
matrix:
os: [ ubuntu-20.04 ]
dc: [ dmd-2.092.1, dmd-2.093.1 ]
flavor: [ prod, devel ]
# Not a matrix row, but referenced as a constant in this file
ebtree_version: [ v6.0.socio10 ]
include:
- { dc: dmd-2.093.1, coverage: 1, closure_check: 1 }
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: "Ensure tools/ exists"
run: mkdir -p ${{ github.workspace }}/tools/
- name: 'Restore ebtree from cache'
id: cache-ebtree
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/tools/
key: ebtree
- name: 'Checkout ebtree ${{ matrix.ebtree_version }}'
uses: actions/checkout@v2
if: steps.cache-ebtree.outputs.cache-hit != 'true'
with:
repository: sociomantic-tsunami/ebtree
ref: ${{ matrix.ebtree_version }}
# Relative to Github workspace
path: tools/ebtree
- name: 'Build ebtree ${{ matrix.ebtree_version }}'
if: steps.cache-ebtree.outputs.cache-hit != 'true'
run: |
# fpm is used to build the `.deb` and depends on ruby
sudo apt-get update
sudo apt-get install -y build-essential ruby ruby-dev
sudo gem install --no-document fpm
# Build the debian package
# Package lives in tools/ebtree/deb/libebtree6[-{dbg,dev}]_$VERSION-distro_arch.deb
# $VERSION is ${{ matrix.ebtree_version }} without the leading 'v'
# E.g. libebtree6[-{dbg,dev}]_6.0.socio10-bionic_amd64.deb
make -C '${{ github.workspace }}/tools/ebtree' deb
- name: Install dependencies
run: |
sudo apt-get update && \
sudo apt-get install -y libxslt-dev liblzo2-dev libgcrypt-dev libgpg-error-dev
sudo dpkg -i ${{ github.workspace }}/tools/ebtree/deb/libebtree6*.deb
- name: Install compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}
# Checkout this repository and its submodules
- uses: actions/checkout@v2
with:
submodules: true
# Required for codecov (codecov/codecov-action#190)
fetch-depth: 2
- name: Test
run: |
make all test V=1 F=${{ matrix.flavor }} COV=${{ matrix.coverage }}
- name: Test closures
if: ${{ matrix.closure_check == 1 }}
env:
F: ${{ matrix.flavor }}
DFLAGS: -vgc
run: |
# Run tests and write compiler output to temporary file
compiler_output=`mktemp`
make fasttest 2>&1 > $compiler_output
# Ensure there are no lines about closure allocations in the output.
# Note explicit check for `grep` exit status 1, i.e. no lines found.
! grep -e "closure" $compiler_output
- name: 'Upload coverage'
if: ${{ matrix.coverage == 1 }}
uses: codecov/codecov-action@v1
with:
flags: ${{ matrix.dc }}-${{ matrix.flavor }}