Merge pull request #552 from diffblue/ebmc-packages-fixup10 #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
id: ${{ steps.draft_release.outputs.id }} | |
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: | |
deb_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/RPMS/x86_64/$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, perform-draft-release] | |
steps: | |
- name: Publish release | |
env: | |
EBMC_VERSION: ${{ needs.get-version-information.outputs.version }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cat > body << EOM | |
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 ${{ 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 ${{ needs.centos8-package.outputs.rpm_package_name }} | |
``` | |
EOM | |
gh release edit ebmc-${{ env.EBMC_VERSION }} --draft=false --notes-file body |