-
Notifications
You must be signed in to change notification settings - Fork 24
181 lines (160 loc) · 4.82 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Syntax reference:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
name: Tests
permissions: read-all
defaults:
run:
shell: bash
on:
push:
paths-ignore:
- '**.md'
- 'LICENSE'
pull_request:
env:
DEBIAN_FRONTEND: noninteractive
jobs:
testing:
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
strategy:
matrix:
cc: ['gcc', 'clang']
container:
# We generally try to support the same set of platforms as shadow does.
# See https://shadow.github.io/docs/guide/supported_platforms.html
- 'ubuntu:20.04'
- 'ubuntu:22.04'
- 'debian:10-slim'
- 'debian:11-slim'
- 'debian:12-slim'
- 'fedora:37'
steps:
- name: Update packages
run: |
case ${{ matrix.container }} in
ubuntu* | debian*)
apt-get update
;;
esac
- name: Checkout
uses: actions/checkout@v2
- name: Install tgen dependencies
run: |
case ${{ matrix.container }} in
ubuntu*)
apt-get install -y \
${{ matrix.cc }} \
cmake \
libglib2.0-dev \
libigraph-dev
;;
debian*)
apt-get install -y \
${{ matrix.cc }} \
cmake \
libglib2.0-dev \
libigraph-dev
;;
fedora*)
dnf install -y \
${{ matrix.cc }} \
cmake \
glib2-devel \
igraph-devel
;;
*)
echo "Unhandled container ${{ matrix.container }}"
exit 1
esac
- name: Build tgen
run: mkdir -p build && cd build && CC=${{ matrix.cc }} cmake -DCMAKE_C_FLAGS="-Wall -Werror" .. && make
- name: Install test dependencies
run: |
case ${{ matrix.container }} in
fedora* | *centos*)
dnf install -y \
diffutils
;;
esac
- name: Test mmodel
run: bash test/run_mmodel_tests.sh
- name: Test tgen
run: bash test/run_tgen_integration_tests.sh
- name: Install tgentools dependencies
run: |
case ${{ matrix.container }} in
ubuntu* | debian*)
apt install -y \
gfortran \
python3 \
python3-dev \
python3-pip \
python3-venv \
libjpeg-dev \
libxml2 \
libxml2-dev \
libxslt1.1 \
libxslt1-dev \
libpng16-16 \
libpng-dev \
libfreetype6 \
libfreetype6-dev \
libblas-dev \
liblapack-dev
;;
fedora*)
dnf install -y \
cmake \
glib2-devel \
libdeflate \
python3 \
python3-pip \
xz
pip3 install virtualenv
;;
*centos*)
dnf install -y \
cmake \
glib2-devel \
libjpeg-turbo-devel \
platform-python-devel \
python3 \
python3-pip \
xz \
zlib-devel
pip3 install virtualenv
;;
*)
echo "Unhandled container ${{ matrix.container }}"
exit 1
esac
- name: Build tgentools
run: |
python3 -m venv build/toolsenv
source build/toolsenv/bin/activate
# Drastically improves time to install requirements on platforms with
# older pip in system packages, such as debian-10.
pip3 install --upgrade pip
pip3 install -r tools/requirements.txt
pip3 install -I tools/
- name: Test tgentools
run: bash test/run_tgentools_integration_tests.sh
test-nix:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install nix
uses: cachix/install-nix-action@v15
# Not strictly required as a separate step, since `check` already builds
# if needed. Might be easier to debug as a distinct step, though.
- name: Build tgen
run: nix --print-build-logs build .#tgen
# Not strictly required as a separate step, since `check` already builds
# if needed. Might be easier to debug as a distinct step, though.
- name: Build tgentools
run: nix --print-build-logs build .#tgentools
- name: Test
run: nix --print-build-logs flake check