-
Notifications
You must be signed in to change notification settings - Fork 15
243 lines (224 loc) · 8.53 KB
/
ebmc-release.yaml
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
on:
push:
tags:
- 'ebmc-*'
name: Create Release
jobs:
get-version-information:
name: Get Version Information
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.split-version.outputs._1 }}
tag_name: ebmc-${{ steps.split-version.outputs._1 }}
steps:
- uses: jungwinter/split@v2
id: split-ref
with:
msg: ${{ github.ref }}
separator: '/'
- uses: jungwinter/split@v2
id: split-version
with:
msg: ${{ steps.split-ref.outputs._2 }}
separator: '-'
perform-draft-release:
name: Perform Draft Release
runs-on: ubuntu-20.04
needs: [get-version-information]
outputs:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
steps:
- name: Create draft release
id: draft_release
uses: actions/create-release@v1
env:
EBMC_VERSION: ${{ needs.get-version-information.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ebmc-${{ env.EBMC_VERSION }}
release_name: ebmc-${{ env.EBMC_VERSION }}
draft: true
prerelease: false
ubuntu-22_04-package:
name: Package for Ubuntu 22.04
runs-on: ubuntu-22.04
needs: [perform-draft-release]
outputs:
rpm_package_name: ${{ steps.create_packages.outputs.deb_package_name }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -yq gcc g++ jq flex bison libxml2-utils ccache
- name: Prepare ccache
uses: actions/cache@v4
with:
save-always: true
path: .ccache
key: ${{ runner.os }}-22.04-make-gcc-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: |
${{ runner.os }}-22.04-make-gcc-${{ github.ref }}
${{ runner.os }}-22.04-make-gcc
- name: ccache environment
run: |
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
- name: Get minisat
run: make -C lib/cbmc/src minisat2-download
- name: Build with make
run: make -C src -j4 CXX="ccache g++"
- name: Run the ebmc tests with SAT
run: make -C regression/ebmc test
- name: Run the verilog tests
run: make -C regression/verilog test
- name: Print ccache stats
run: ccache -s
- name: Create .deb
id: create_packages
run: |
VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)
mkdir -p ebmc-${VERSION}/DEBIAN
mkdir -p ebmc-${VERSION}/usr/bin
cp src/ebmc/ebmc ebmc-${VERSION}/usr/bin
strip ebmc-${VERSION}/usr/bin/ebmc
cat << EOM > ebmc-${VERSION}/DEBIAN/control
Package: ebmc
Version: ${VERSION}
Architecture: amd64
Maintainer: Daniel Kroening <[email protected]>
Depends:
Installed-Size: 6600
Homepage: http://www.cprover.org/ebmc/
Description: The EBMC Model Checker
EOM
sudo chown root:root -R ebmc-${VERSION}
dpkg -b ebmc-${VERSION}
deb_package_name="$(ls *.deb)"
echo "deb_package_path=$PWD/$deb_package_name" >> $GITHUB_OUTPUT
echo "deb_package_name=ubuntu-22.04-$deb_package_name" >> $GITHUB_OUTPUT
- name: Upload binary packages
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.perform-draft-release.outputs.upload_url }}
asset_path: ${{ steps.create_packages.outputs.deb_package_path }}
asset_name: ${{ steps.create_packages.outputs.deb_package_name }}
asset_content_type: application/x-deb
centos8-package:
name: Package for CentOS 8
runs-on: ubuntu-22.04
needs: [perform-draft-release]
outputs:
rpm_package_name: ${{ steps.create_packages.outputs.rpm_package_name }}
container:
image: centos:8
steps:
- name: Install Packages
run: |
sed -i -e "s|mirrorlist=|#mirrorlist=|g" -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-Linux-*
yum -y install make gcc-c++ flex bison git rpmdevtools wget
wget --no-verbose https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3-linux-x86_64.tar.xz
tar xJf ccache-4.8.3-linux-x86_64.tar.xz
cp ccache-4.8.3-linux-x86_64/ccache /usr/bin/
- name: cache for ccache
uses: actions/cache@v4
with:
path: /github/home/.cache/ccache
save-always: true
key: ${{ runner.os }}-centos8-make-gcc-${{ github.ref }}-${{ github.sha }}-PR
restore-keys: ${{ runner.os }}-centos8-make-gcc-
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Zero ccache stats and limit in size
run: ccache -z --max-size=500M
- name: ccache path
run: ccache -p | grep cache_dir
- name: Get minisat
run: make -C lib/cbmc/src minisat2-download
- name: Build with make
run: make CXX="ccache g++ -Wno-class-memaccess" LIBS="-lstdc++fs" -C src -j4
- name: Print ccache stats
run: ccache -s
- name: Run the ebmc tests with SAT
run: |
rm regression/ebmc/neural-liveness/counter1.desc
make -C regression/ebmc test
- name: Run the verilog tests
run: make -C regression/verilog test
- name: Create .rpm
id: create_packages
run: |
VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)
SRC=`pwd`
rpmdev-setuptree
cat > ~/rpmbuild/SPECS/ebmc.spec << EOM
#This is a spec file for ebmc
Summary: EBMC Model Checker
License: BSD 3-clause
Name: ebmc
Version: ${VERSION}
Release: 1
Prefix: /usr
Group: Development/Tools
%description
EBMC is a formal verification tool for hardware designs.
%prep
%build
%install
mkdir %{buildroot}/usr
mkdir %{buildroot}/usr/lib
mkdir %{buildroot}/usr/bin
mkdir %{buildroot}/usr/lib/ebmc
cp ${SRC}/src/ebmc/ebmc %{buildroot}/usr/bin/
strip %{buildroot}/usr/bin/ebmc
%files
/usr/bin/ebmc
EOM
echo Building ebmc-${VERSION}-1.x86_64.rpm
(cd ~/rpmbuild/SPECS ; rpmbuild -v -bb ebmc.spec )
rpm_package_name=ebmc-${VERSION}-1.x86_64.rpm
echo "rpm_package_path=$HOME/rpmbuild/SPECS/$rpm_package_name" >> $GITHUB_OUTPUT
echo "rpm_package_name=centos8-$rpm_package_name" >> $GITHUB_OUTPUT
- name: Upload binary packages
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.perform-draft-release.outputs.upload_url }}
asset_path: ${{ steps.create_packages.outputs.rpm_package_path }}
asset_name: ${{ steps.create_packages.outputs.rpm_package_name }}
asset_content_type: application/x-rpm
perform-release:
name: Perform Release
runs-on: ubuntu-20.04
needs: [ubuntu-22_04-package, centos8-package, get-version-information]
steps:
- name: Create release
uses: actions/create-release@v1
env:
EBMC_VERSION: ${{ needs.get-version-information.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ebmc-${{ env.EBMC_VERSION }}
release_name: ebmc-${{ env.EBMC_VERSION }}
draft: false
prerelease: false
body: |
This is EBMC version ${{ env.EBMC_VERSION }}.
## Ubuntu
On Ubuntu, install EBMC by downloading the *.deb package below for your version of Ubuntu and install with
```sh
dpkg -i ubuntu-22.04-ebmc-${{ env.EBMC_VERSION }}-Linux.deb
${{ needs.ubuntu-22_04-package.outputs.deb_package_name }}
```
## CentOS
On CentOS, install EBMC by downloading the *.rpm package below for your version of CentOS and install with
```sh
rpm -i ebmc-${{ env.EBMC_VERSION }}-1.x86_64.rpm
${{ needs.centos8-package.outputs.rpm_package_name }}
```