|
| 1 | +name: linux-riscv64 dotnet-runtime aot |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + |
| 10 | + steps: |
| 11 | + - name: Make space for runtime build # we only need docker on the host |
| 12 | + run: | |
| 13 | + df -h |
| 14 | + sudo rm -rf \ |
| 15 | + "$AGENT_TOOLSDIRECTORY" \ |
| 16 | + /opt/google/chrome \ |
| 17 | + /opt/microsoft/msedge \ |
| 18 | + /opt/microsoft/powershell \ |
| 19 | + /opt/pipx \ |
| 20 | + /usr/lib/mono \ |
| 21 | + /usr/local/julia* \ |
| 22 | + /usr/local/lib/android \ |
| 23 | + /usr/local/lib/node_modules \ |
| 24 | + /usr/local/share/chromium \ |
| 25 | + /usr/local/share/powershell \ |
| 26 | + /usr/share/dotnet \ |
| 27 | + /usr/share/swift |
| 28 | + df -h |
| 29 | +
|
| 30 | + - name: runtime, libs and nativeaot smoke tests build |
| 31 | + run: | |
| 32 | + git clone https://github.com/dotnet/runtime --single-branch --depth 1 |
| 33 | + docker run --rm -v$(pwd)/runtime:/runtime -e ROOTFS_DIR=/crossrootfs/riscv64 \ |
| 34 | + mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-riscv64 \ |
| 35 | + sh -c ' |
| 36 | + curl -sSL https://github.com/dotnet/runtime/pull/113179.patch | git -C /runtime apply - && |
| 37 | + echo "Building for target..." && |
| 38 | + /runtime/build.sh -ci -arch riscv64 -cross -s clr+libs+host -c Debug -rc Checked --keepnativesymbols true -p:StageOneBuild=true && |
| 39 | + /runtime/build.sh -ci -arch riscv64 -cross -s tools+clr.tools+tools.illink -c Debug -rc Checked --keepnativesymbols true -p:StageTwoBuild=true && |
| 40 | + echo "Building for host..." && |
| 41 | + tdnf install -y cmake llvm lld lldb clang python curl libicu-devel openssl-devel krb5-devel lttng-ust-devel pigz cpio && |
| 42 | + /runtime/build.sh -ci -arch x64 -s clr+libs -c Debug -rc Checked --keepnativesymbols true && |
| 43 | + echo "Building smoke tests..." && |
| 44 | + cp /runtime/artifacts/bin/coreclr/linux.riscv64.Checked/x64/libclrjit_unix_riscv64_x64.so /runtime/artifacts/bin/coreclr/linux.x64.Checked/ilc-published && |
| 45 | + cp /runtime/artifacts/bin/coreclr/linux.x64.Checked/ilc-published/ilc /runtime/artifacts/bin/coreclr/linux.riscv64.Checked/x64/ilc/ilc && |
| 46 | + SysRoot=$ROOTFS_DIR LinkerFlavor=lld /runtime/src/tests/build.sh -ci -riscv64 -cross -nativeaot -tree:nativeaot -Checked -p:TasksConfiguration=Debug -p:LibrariesConfiguration=Debug -keepnativesymbols -p:UseLocalAppHostPack=true -p:UseNativeAotForComponents=true -p:TestNativeAot=true |
| 47 | + ' |
| 48 | +
|
| 49 | + - name: run tests in qemu |
| 50 | + run: | |
| 51 | + docker run --privileged --rm tonistiigi/binfmt --install all |
| 52 | + docker run --rm -v$(pwd)/runtime:/runtime -e ROOTFS_DIR=/crossrootfs/riscv64 \ |
| 53 | + -e CORE_ROOT=/runtime/artifacts/tests/coreclr/linux.riscv64.Checked/Tests/Core_Root \ |
| 54 | + --platform linux/riscv64 ubuntu \ |
| 55 | + bash -c ' |
| 56 | + apt update && apt install -y file llvm && |
| 57 | + mkdir -p $CORE_ROOT/SuperFileCheck/runtimes/linux-riscv64/native && |
| 58 | + ln -s /usr/bin/llvm-dwarfdump $CORE_ROOT/SuperFileCheck/runtimes/linux-riscv64/native; |
| 59 | +
|
| 60 | + fail=0; |
| 61 | + while IFS=: read -r test _; do |
| 62 | + echo "Running $test..."; |
| 63 | + pushd "$(dirname $test)/.."; |
| 64 | + "$test"; |
| 65 | + exitcode=$?; |
| 66 | + popd; |
| 67 | + if [ "$exitcode" -ne 100 ]; then |
| 68 | + echo "$test failed with exit code $exitcode"; |
| 69 | + fail=1; |
| 70 | + fi; |
| 71 | + done < <(find /runtime/artifacts/tests/coreclr/linux.riscv64.Checked/nativeaot/SmokeTests -path "*/native/*" -type f -exec file {} \; | grep ELF.*executable); |
| 72 | +
|
| 73 | + if [ "$fail" -eq 1 ]; then exit 1; fi |
| 74 | + ' |
0 commit comments