Skip to content

Commit 87f2920

Browse files
authored
Merge pull request #542 from diffblue/release-does-package
Release CI flow: release flow now does packaging
2 parents c3e0943 + 64c57fd commit 87f2920

File tree

2 files changed

+155
-152
lines changed

2 files changed

+155
-152
lines changed

.github/workflows/ebmc-packages.yaml

Lines changed: 0 additions & 149 deletions
This file was deleted.

.github/workflows/ebmc-release.yaml

Lines changed: 155 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,150 @@ on:
66
name: Create Release
77

88
jobs:
9+
ubuntu-22_04-package:
10+
name: Package for Ubuntu 22.04
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
- name: Fetch dependencies
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install --no-install-recommends -yq gcc g++ jq flex bison libxml2-utils ccache
20+
- name: Prepare ccache
21+
uses: actions/cache@v4
22+
with:
23+
save-always: true
24+
path: .ccache
25+
key: ${{ runner.os }}-20.04-make-gcc-${{ github.ref }}-${{ github.sha }}-PR
26+
restore-keys: |
27+
${{ runner.os }}-20.04-make-gcc-${{ github.ref }}
28+
${{ runner.os }}-20.04-make-gcc
29+
- name: ccache environment
30+
run: |
31+
echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV
32+
echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV
33+
- name: Get minisat
34+
run: make -C lib/cbmc/src minisat2-download
35+
- name: Build with make
36+
run: make -C src -j2 CXX="ccache g++"
37+
- name: Run the ebmc tests with SAT
38+
run: make -C regression/ebmc test
39+
- name: Run the verilog tests
40+
run: make -C regression/verilog test
41+
- name: Print ccache stats
42+
run: ccache -s
43+
- name: Create packages
44+
id: create_packages
45+
run: |
46+
VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)
47+
mkdir -p ebmc-${VERSION}/DEBIAN
48+
mkdir -p ebmc-${VERSION}/usr/bin
49+
cp src/ebmc/ebmc ebmc-${VERSION}/usr/bin
50+
cat << EOM > ebmc-${VERSION}/DEBIAN/control
51+
Package: ebmc
52+
Version: ${VERSION}
53+
Architecture: amd64
54+
Maintainer: Daniel Kroening <dkr@amazon.com>
55+
Depends:
56+
Installed-Size: 6600
57+
Homepage: http://www.cprover.org/ebmc/
58+
Description: The EBMC Model Checker
59+
EOM
60+
chown root:root -R ebmc-${VERSION}
61+
dpkg -b ebmc-${VERSION}
62+
deb_package_name="$(ls *.deb)"
63+
echo "deb_package=./build/$deb_package_name" >> $GITHUB_OUTPUT
64+
echo "deb_package_name=ubuntu-22.04-$deb_package_name" >> $GITHUB_OUTPUT
65+
- name: Get release info
66+
id: get_release_info
67+
uses: bruceadams/get-release@v1.3.2
68+
- name: Upload binary packages
69+
uses: actions/upload-release-asset@v1
70+
with:
71+
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
72+
asset_path: ${{ steps.create_packages.outputs.deb_package }}
73+
asset_name: ${{ steps.create_packages.outputs.deb_package_name }}
74+
asset_content_type: application/x-deb
75+
76+
centos8-package:
77+
name: Package for CentOS 8
78+
runs-on: ubuntu-22.04
79+
container:
80+
image: centos:8
81+
steps:
82+
- name: Install Packages
83+
run: |
84+
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-*
85+
yum -y install make gcc-c++ flex bison git rpmdevtools wget
86+
wget --no-verbose https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3-linux-x86_64.tar.xz
87+
tar xJf ccache-4.8.3-linux-x86_64.tar.xz
88+
cp ccache-4.8.3-linux-x86_64/ccache /usr/bin/
89+
- name: cache for ccache
90+
uses: actions/cache@v4
91+
with:
92+
path: /github/home/.cache/ccache
93+
save-always: true
94+
key: ${{ runner.os }}-centos8-make-gcc-${{ github.ref }}-${{ github.sha }}-PR
95+
restore-keys: ${{ runner.os }}-centos8-make-gcc-
96+
- uses: actions/checkout@v4
97+
with:
98+
submodules: recursive
99+
- name: Zero ccache stats and limit in size
100+
run: ccache -z --max-size=500M
101+
- name: ccache path
102+
run: ccache -p | grep cache_dir
103+
- name: Get minisat
104+
run: make -C lib/cbmc/src minisat2-download
105+
- name: Build with make
106+
run: make CXX="ccache g++ -Wno-class-memaccess" LIBS="-lstdc++fs" -C src -j2
107+
- name: Run the ebmc tests with SAT
108+
run: |
109+
rm regression/ebmc/neural-liveness/counter1.desc
110+
make -C regression/ebmc test
111+
- name: Run the verilog tests
112+
run: make -C regression/verilog test
113+
- name: Create .rpm
114+
run: |
115+
VERSION=$(echo ${{ github.ref }} | cut -d "/" -f 3 | cut -d "-" -f 2)
116+
rpmdev-setuptree
117+
118+
cat > ~/rpmbuild/SPECS/ebmc.spec << EOM
119+
#This is a spec file for ebmc
120+
121+
Summary: EBMC Model Checker
122+
License: BSD 3-clause
123+
Name: ebmc
124+
Version: ${VERSION}
125+
Release: 1
126+
Prefix: /usr
127+
Group: Development/Tools
128+
Requires:
129+
130+
%description
131+
EBMC is a formal verification tool for hardware designs.
132+
133+
%prep
134+
135+
%build
136+
137+
%install
138+
mkdir %{buildroot}/usr
139+
mkdir %{buildroot}/usr/lib
140+
mkdir %{buildroot}/usr/bin
141+
mkdir %{buildroot}/usr/lib/ebmc
142+
cp ${SRC}/src/ebmc/jcover %{buildroot}/usr/bin/
143+
144+
%files
145+
/usr/bin/ebmc
146+
EOM
147+
148+
echo Building ebmc-${VERSION}-1.x86_64.rpm
149+
(cd ~/rpmbuild/SPECS ; rpmbuild -v -bb ebmc.spec )
150+
- name: Print ccache stats
151+
run: ccache -s
152+
9153
get-version-information:
10154
name: Get Version Information
11155
runs-on: ubuntu-20.04
@@ -22,10 +166,11 @@ jobs:
22166
with:
23167
msg: ${{ steps.split-ref.outputs._2 }}
24168
separator: '-'
169+
25170
perform-release:
26171
name: Perform Release
27172
runs-on: ubuntu-20.04
28-
needs: get-version-information
173+
needs: [ubuntu-22_04-package, centos8-package, get-version-information]
29174
steps:
30175
- name: Create release
31176
uses: actions/create-release@v1
@@ -45,6 +190,13 @@ jobs:
45190
On Ubuntu, install EBMC by downloading the *.deb package below for your version of Ubuntu and install with
46191
47192
```sh
48-
# Ubuntu 22:
49-
$ dpkg -i ubuntu-22.04-ebmc-${{ env.EBMC_VERSION }}-Linux.deb
193+
dpkg -i ubuntu-22.04-ebmc-${{ env.EBMC_VERSION }}-Linux.deb
194+
```
195+
196+
## CentOS
197+
198+
On CentOS, install EBMC by downloading the *.rpm package below for your version of CentOS and install with
199+
200+
```sh
201+
rpm -i ebmc-${{ env.EBMC_VERSION }}-1.x86_64.rpm
50202
```

0 commit comments

Comments
 (0)