build-riscv64 pipeline: install everything needed for Clang builds #115
This file contains hidden or 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
| name: Build RISC-V64 | |
| on: | |
| push: | |
| branches: [master, main] | |
| pull_request: | |
| branches: [master, main] | |
| workflow_dispatch: | |
| inputs: | |
| publish: | |
| description: Publish Docker image | |
| type: boolean | |
| required: false | |
| jobs: | |
| build_riscv64: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ubuntu:25.04 | |
| options: --privileged -v /var/run/docker.sock:/var/run/docker.sock | |
| name: Build RISC-V64 on Ubuntu 25.04 | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y \ | |
| git \ | |
| gcc-riscv64-linux-gnu \ | |
| g++-riscv64-linux-gnu \ | |
| binutils-riscv64-linux-gnu \ | |
| llvm \ | |
| clang \ | |
| lld \ | |
| xxd \ | |
| python3 \ | |
| python3-pip \ | |
| wget \ | |
| curl \ | |
| ca-certificates \ | |
| yq \ | |
| docker.io \ | |
| libicu-dev libicu76 | |
| pip3 install lief pyelftools --break-system-packages | |
| # gcc-riscv64-linux-gnu only ships hard-float (lp64d) glibc stubs. We | |
| # compile native modules with -mabi=lp64 (soft-float) to match zisk's | |
| # crt1.o, so we need an empty gnu/stubs-lp64.h marker. | |
| touch /usr/riscv64-linux-gnu/include/gnu/stubs-lp64.h | |
| - name: Install .NET 10 | |
| run: | | |
| wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh | |
| chmod +x dotnet-install.sh | |
| ./dotnet-install.sh --channel 10.0 --install-dir /usr/share/dotnet | |
| ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet | |
| echo "DOTNET_ROOT=/usr/share/dotnet" >> $GITHUB_ENV | |
| echo "/usr/share/dotnet" >> $GITHUB_PATH | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Build modules (riscv64) | |
| run: ./build.sh modules riscv64 | |
| - name: Build bflat (riscv64) | |
| run: ./build.sh bflat riscv64 | |
| - name: Set up Docker Buildx | |
| if: github.event.inputs.publish == 'true' | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| if: github.event.inputs.publish == 'true' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| - name: Publish to Docker Hub | |
| if: github.event.inputs.publish == 'true' | |
| run: | | |
| docker buildx build . \ | |
| -t nethermindeth/bflat-riscv64:latest \ | |
| -t nethermindeth/bflat-riscv64:$GITHUB_SHA \ | |
| --push |