Skip to content

feat: build rust binaries in parallel #153

feat: build rust binaries in parallel

feat: build rust binaries in parallel #153

Workflow file for this run

name: Build
on: [push]
env:
TOOLCHAIN_IMAGE: ${{ github.repository_owner }}/toolchain
TOOLCHAIN_TAG: 0.16.0
TOOLS_IMAGE: ${{ github.repository_owner }}/machine-emulator-tools
jobs:
tools:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- 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 }}:devel.build
push: false
load: true
build-args: |
TOOLS_DEB=${{ env.TOOLS_DEB }}
LINUX_SOURCES_VERSION=${{ env.LINUX_SOURCES_VERSION }}
LINUX_SOURCES_URLPATH=${{ env.LINUX_SOURCES_URLPATH }}
cache-from: type=gha,scope=regular,mode=max
cache-to: type=gha,scope=regular
- name: Retrieve artifacts
run: make copy TOOLS_IMAGE=${{ env.TOOLS_IMAGE }}:devel.build
- 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: Checksum artifacts
run: |
sha512sum ${{ env.TOOLS_DEB }} > ${{ env.TOOLS_DEB }}.sha512
sha512sum ${{ env.TOOLS_ROOTFS }} > ${{ env.TOOLS_ROOTFS }}.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
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build yield tool
run: cd linux/htif && make toolchain-exec CONTAINER_COMMAND="/usr/bin/make yield.toolchain"
- name: Build ioctl-echo-loop tool
run: cd linux/rollup/ioctl-echo-loop && make toolchain-exec CONTAINER_COMMAND="/usr/bin/make ioctl-echo-loop.toolchain"
- name: Build rollup tool
run: cd linux/rollup/rollup && make toolchain-exec CONTAINER_COMMAND="/usr/bin/make rollup.toolchain"
- name: Build rollup http server
run: cd linux/rollup/http/rollup-http-server && ./build.sh
- name: Build echo dapp
run: cd linux/rollup/http/echo-dapp && ./build.sh
- name: Test rollup-http-server and echo-dapp client
run: |
cd linux/rollup/http/rollup-http-server
USE_ROLLUP_BINDINGS_MOCK=1 cargo test -- --show-output --test-threads=1