Skip to content

fix: improve coverage #373

fix: improve coverage

fix: improve coverage #373

Workflow file for this run

name: Build
on: [push]
jobs:
build:
needs: [test]
runs-on: ubuntu-latest-8-cores
steps:
- name: Install libarchive-tools
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential autoconf automake libarchive-dev libarchive-tools
# Building from source cause the provided debian package is for Debian Bookworm
- name: Download, build and install xgenext2fs
run: |
wget https://github.com/cartesi/genext2fs/archive/refs/tags/v1.5.5.tar.gz
echo "ea648aa2a149c732aa07cd44218cdf63e881cfdfbb7e5cad3ecc6963661e31e2 v1.5.5.tar.gz" | sha256sum -c -
tar -xzf v1.5.5.tar.gz
cd genext2fs-1.5.5
./autogen.sh
./configure
make
sudo make install
rm -rf genext2fs-1.5.5 v1.5.5.tar.gz
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Export makefile variables
run: make env >> $GITHUB_ENV
- name: Create debian package control file
run: make control
- name: Buildx setup
uses: docker/setup-buildx-action@v2
- name: Build [${{ env.TOOLS_DEB }}]
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
tags: ${{ env.TOOLS_IMAGE }}
push: false
load: true
build-args: |
TOOLS_DEB=${{ env.TOOLS_DEB }}
IMAGE_KERNEL_VERSION=${{ env.IMAGE_KERNEL_VERSION }}
LINUX_VERSION=${{ env.LINUX_VERSION }}
LINUX_HEADERS_URLPATH=${{ env.LINUX_HEADERS_URLPATH }}
cache-from: type=gha,scope=regular,mode=max
cache-to: type=gha,scope=regular
- name: Retrieve artifacts
run: make copy
- name: Build rootfs
run: make fs
- name: Upload [${{ env.TOOLS_DEB }}]
uses: actions/upload-artifact@v3
with:
path: ${{ env.TOOLS_DEB }}
- name: Upload [${{ env.TOOLS_ROOTFS }}]
uses: actions/upload-artifact@v3
with:
path: ${{ env.TOOLS_ROOTFS }}
- name: Build [${{ env.TOOLS_LIBCMT }}]
id: docker_build_libcmt
uses: docker/build-push-action@v4
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
tags: ${{ env.TOOLS_IMAGE }}-libcmt
push: false
load: true
target: libcmt-debian-packager
build-args: |
TOOLS_LIBCMT=${{ env.TOOLS_LIBCMT }}
cache-from: type=gha,scope=regular,mode=max
cache-to: type=gha,scope=regular
- name: Retrieve artifacts
run: make copy-libcmt
- name: Upload [${{ env.TOOLS_LIBCMT }}]
uses: actions/upload-artifact@v3
with:
path: ${{ env.TOOLS_LIBCMT }}
- name: Checksum artifacts
if: startsWith(github.ref, 'refs/tags/v')
run: |
sha512sum ${{ env.TOOLS_DEB }} > ${{ env.TOOLS_DEB }}.sha512
sha512sum ${{ env.TOOLS_ROOTFS }} > ${{ env.TOOLS_ROOTFS }}.sha512
sha512sum ${{ env.TOOLS_LIBCMT }} > ${{ env.TOOLS_LIBCMT }}.sha512
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
prerelease: true
files: |
${{ env.TOOLS_DEB }}
${{ env.TOOLS_DEB }}.sha512
${{ env.TOOLS_ROOTFS }}
${{ env.TOOLS_ROOTFS }}.sha512
${{ env.TOOLS_LIBCMT }}
${{ env.TOOLS_LIBCMT }}.sha512
test:
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Test libcmt mock on host
run: |
make -C sys-utils/libcmt/ -j$(nproc) host test
- name: Test rollup-http-server and echo-dapp client on host
run: |
cd rollup-http/rollup-http-server
MOCK_BUILD=true cargo test -- --show-output --test-threads=1