Repository navigation
Expand file tree
/
Copy pathconfig.yml
More file actions
165 lines (139 loc) · 3.76 KB
/
Copy pathconfig.yml
File metadata and controls
165 lines (139 loc) · 3.76 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
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
version: 2.1
common_parameters: &common_parameters
os:
type: enum
enum: [ alpine, debian, linux, macos, "win/default" ]
## ORBS ##
orbs:
win: circleci/windows@4.1.1
## EXECUTORS ##
executors:
alpine:
resource_class: medium
docker:
- image: docker.io/library/alpine:3.16
debian:
resource_class: medium
docker:
- image: docker.io/library/debian:11
linux:
resource_class: medium
machine:
image: ubuntu-2004:202101-01
macos:
resource_class: medium
macos:
xcode: 13.4.1
## COMMANDS ##
commands:
prepare:
parameters:
<<: *common_parameters
steps:
# NOTE: minimal effort to allow moving most conditionals out of ci config
- when:
condition:
equal: [ alpine, << parameters.os >> ]
steps:
- run: apk add -U make
- when:
condition:
or:
- equal: [ debian, << parameters.os >> ]
- equal: [ linux, << parameters.os >> ]
steps:
- run: apt-get update -y && apt-get install -y make
- when:
condition:
not:
equal: [ "win/default", << parameters.os >> ]
steps:
- run: make install-deps EXECUTOR=<< parameters.os >>
- when:
condition:
equal: [ "win/default", << parameters.os >> ]
steps:
- run: choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=User"'
- run: choco install ninja
build:
parameters:
<<: *common_parameters
steps:
- when:
condition:
not:
equal: [ "win/default", << parameters.os >> ]
steps:
- run:
# NOTE: the circle ci container executor reports the memory/cpu stats
# of the host machine (https://ideas.circleci.com/ideas/CCI-I-578),
# `nproc` will return 36 on docker/medium resource_class,
# ninja parallelizes accordingly, which leads to overloading
# and circleci eventually terminating the builds:
#
# ninja: job failed: /usr/bin/c++ [...]
# c++: fatal error: Killed signal terminated program cc1plus
# compilation terminated
#
# force overwrite job count here:
command: make lief JOBS=3
- when:
condition:
equal: [ "win/default", << parameters.os >> ]
steps:
- run:
command: refreshenv & cd vendor\lief & python ./setup.py --ninja build_ext -b ..\..\dist\lief
shell: cmd.exe
- persist_to_workspace:
root: .
paths:
- dist/lief
test:
steps:
- attach_workspace:
at: .
- run: make test
## JOBS ##
jobs:
build:
parameters:
<<: *common_parameters
executor: { name: << parameters.os >> }
steps:
- checkout
- prepare:
os: << parameters.os >>
- build:
os: << parameters.os >>
- store_artifacts:
path: dist
- store_artifacts:
path: postject-api.h
- store_artifacts:
path: postject.py
test:
parameters:
<<: *common_parameters
executor: { name: << parameters.os >> }
steps:
- checkout
- prepare:
os: << parameters.os >>
- test
## WORKFLOWS ##
build_matrix: &build_matrix
matrix:
parameters:
os: [ alpine, debian, macos, "win/default" ]
test_matrix: &test_matrix
matrix:
parameters:
os: [ alpine, debian, macos ]
workflows:
postject:
jobs:
- build:
<<: *build_matrix
- test:
<<: *test_matrix
requires: [ build-<<matrix.os>> ]