ci: test that BUILD_RUST=ON builds (#1459)

This commit is contained in:
Lofty 2025-03-03 13:44:33 +00:00 committed by GitHub
parent 661f76d51a
commit 0492c55efd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 2 deletions

26
.github/ci/build_rust.sh vendored Normal file
View File

@ -0,0 +1,26 @@
#!/bin/bash
function get_dependencies {
:
}
function build_nextpnr {
mkdir build
pushd build
cmake .. -DARCH=generic -DWERROR=on -DBUILD_RUST=on
make nextpnr-generic -j`nproc`
popd
}
function run_tests {
export PATH=${GITHUB_WORKSPACE}/.yosys/bin:$PATH
( export NPNR=$(pwd)/build/nextpnr-generic && cd tests/generic/flow && ./run.sh )
}
function run_archcheck {
pushd build
# This isn't strictly necessary, since it's tested by build_generic.sh
# but it can't hurt to run it anyway.
./nextpnr-generic --uarch example --test
popd
}

View File

@ -9,7 +9,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
arch: [mistral, ice40, ecp5, generic, nexus, machxo2, himbaechel] arch: [mistral, ice40, ecp5, generic, nexus, machxo2, himbaechel, rust]
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
DEPS_PATH: ${{ github.workspace }}/deps DEPS_PATH: ${{ github.workspace }}/deps
@ -30,7 +30,7 @@ jobs:
- name: Install - name: Install
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install git make cmake libboost-all-dev python3-dev pypy3 libeigen3-dev tcl-dev lzma-dev libftdi-dev clang bison flex swig qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools iverilog libreadline-dev liblzma-dev sudo apt-get install git make cmake libboost-all-dev python3-dev pypy3 libeigen3-dev tcl-dev lzma-dev libftdi-dev clang bison flex swig qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools iverilog libreadline-dev liblzma-dev cargo rustc
- name: Cache yosys installation - name: Cache yosys installation
uses: actions/cache@v4 uses: actions/cache@v4