2024-10-16 04:08:18 +00:00
|
|
|
##################################
|
|
|
|
# install.yml
|
|
|
|
# jcarlin@hmc.edu October 2024
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
|
|
|
#
|
|
|
|
# GitHub Action to test the wally-tool-chain-install.sh script for all supported linux distributions
|
|
|
|
# and configurations. Runs weekly and on pull requests that modify the installation scripts.
|
|
|
|
##################################
|
|
|
|
|
2024-07-16 07:14:57 +00:00
|
|
|
name: Installation
|
2024-10-16 04:16:21 +00:00
|
|
|
|
|
|
|
# Run on PR that modifies the installation scripts, weekly, or manually
|
2024-10-16 02:48:24 +00:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2024-10-16 03:27:44 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- 'bin/wally-tool-chain-install.sh'
|
|
|
|
- 'bin/wally-distro-check.sh'
|
2024-10-30 22:40:38 +00:00
|
|
|
- 'bin/wally-package-install.sh'
|
2025-01-06 00:22:00 +00:00
|
|
|
- '.github/workflows/install.yml'
|
2024-10-16 02:48:24 +00:00
|
|
|
schedule:
|
2024-10-16 05:01:28 +00:00
|
|
|
- cron: "0 7 * * 3" # Run at 12:00 AM Pacific Time on Wednesdays
|
2024-10-16 04:16:21 +00:00
|
|
|
|
|
|
|
# Use bash shell with extra GitHub Actions options for all jobs
|
2024-07-18 04:34:55 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2024-10-16 04:16:21 +00:00
|
|
|
|
2024-07-05 03:52:52 +00:00
|
|
|
jobs:
|
2024-10-15 06:11:17 +00:00
|
|
|
installation_test:
|
|
|
|
name: Test installation for ${{ matrix.name }}
|
2024-07-16 07:14:57 +00:00
|
|
|
strategy:
|
2024-07-16 07:33:56 +00:00
|
|
|
fail-fast: false
|
2024-07-16 07:14:57 +00:00
|
|
|
matrix:
|
2024-10-15 06:11:17 +00:00
|
|
|
include:
|
|
|
|
# Ubuntu Installations
|
|
|
|
- name: ubuntu-20.04
|
|
|
|
os: ubuntu-20.04
|
|
|
|
container: null
|
2024-11-24 09:32:20 +00:00
|
|
|
regressionFail: true
|
2024-10-15 06:11:17 +00:00
|
|
|
- name: ubuntu-22.04
|
|
|
|
os: ubuntu-22.04
|
|
|
|
container: null
|
|
|
|
- name: ubuntu-24.04
|
|
|
|
os: ubuntu-24.04
|
|
|
|
container: null
|
2024-11-24 04:15:25 +00:00
|
|
|
# Debian Installations
|
|
|
|
- name: debian-12
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: debian:12
|
|
|
|
imageFamily: debian
|
2024-11-24 06:09:38 +00:00
|
|
|
- name: debian-11
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: debian:11
|
|
|
|
imageFamily: debian
|
2024-10-15 06:11:17 +00:00
|
|
|
# Red Hat Installations
|
|
|
|
- name: rocky-8
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: rockylinux:8
|
2024-11-24 04:15:25 +00:00
|
|
|
imageFamily: redhat
|
|
|
|
regressionFail: true
|
2024-10-15 06:11:17 +00:00
|
|
|
- name: rocky-9
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: rockylinux:9
|
2024-11-24 04:15:25 +00:00
|
|
|
imageFamily: redhat
|
2024-10-15 06:11:17 +00:00
|
|
|
- name: almalinux-8
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: almalinux:8
|
2024-11-24 04:15:25 +00:00
|
|
|
imageFamily: redhat
|
|
|
|
regressionFail: true
|
2024-10-15 06:11:17 +00:00
|
|
|
- name: almalinux-9
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: almalinux:9
|
2024-11-24 04:15:25 +00:00
|
|
|
imageFamily: redhat
|
2024-11-24 23:57:42 +00:00
|
|
|
# SUSE Installations
|
|
|
|
- name: opensuse-15.6
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: opensuse/leap:15.6
|
|
|
|
imageFamily: suse
|
2024-10-15 07:11:09 +00:00
|
|
|
# User level installation
|
|
|
|
- name: user-install
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: null
|
|
|
|
user: true
|
|
|
|
# Custom location installation
|
|
|
|
- name: custom-install
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: null
|
|
|
|
riscv_path: /home/riscv
|
2024-10-20 08:00:19 +00:00
|
|
|
# Custom location user level installation
|
|
|
|
- name: custom-user-install
|
|
|
|
os: ubuntu-latest
|
|
|
|
image: null
|
|
|
|
user: true
|
2024-10-21 05:53:42 +00:00
|
|
|
riscv_path: $HOME/riscv-toolchain
|
2024-07-17 08:25:06 +00:00
|
|
|
|
2024-10-16 04:16:21 +00:00
|
|
|
# run on selected version of ubuntu or on ubuntu-latest with docker image
|
2024-10-15 06:11:17 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2024-07-16 07:14:57 +00:00
|
|
|
container:
|
2024-10-15 06:11:17 +00:00
|
|
|
image: ${{ matrix.image }}
|
2024-10-16 04:16:21 +00:00
|
|
|
options: --privileged --mount type=bind,source=/,target=/host --pid=host --entrypoint /bin/bash # Allow for connection with host
|
|
|
|
|
2024-07-16 07:14:57 +00:00
|
|
|
steps:
|
2024-10-16 04:16:21 +00:00
|
|
|
# Docker images need git installed or the checkout action fails
|
2024-11-24 04:15:25 +00:00
|
|
|
- name: Install Dependencies for Container Image
|
2024-10-15 06:23:40 +00:00
|
|
|
if: ${{ matrix.image != null }}
|
2024-07-17 08:46:51 +00:00
|
|
|
run: |
|
2024-11-24 04:15:25 +00:00
|
|
|
if [ ${{ matrix.imageFamily }} == "debian" ]; then
|
|
|
|
apt-get update
|
2025-01-05 16:41:02 +00:00
|
|
|
apt-get install -y git
|
2024-11-24 04:15:25 +00:00
|
|
|
elif [ ${{ matrix.imageFamily }} == "redhat" ]; then
|
2025-01-05 16:41:02 +00:00
|
|
|
dnf install -y git
|
2024-11-24 04:15:25 +00:00
|
|
|
dnf install curl -y --allowerasing || true
|
2024-11-24 23:57:42 +00:00
|
|
|
elif [ ${{ matrix.imageFamily }} == "suse" ]; then
|
2025-01-05 16:41:02 +00:00
|
|
|
zypper install -y git
|
2024-11-24 04:15:25 +00:00
|
|
|
fi
|
2024-10-16 04:16:21 +00:00
|
|
|
# Only clone submodules needed for standard tests/regression to save space
|
2024-07-17 08:50:19 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-10-14 04:17:20 +00:00
|
|
|
- name: Clone Necessary Submodules
|
2024-10-14 04:48:00 +00:00
|
|
|
run: |
|
|
|
|
git config --global --add safe.directory '*'
|
2024-10-14 07:48:39 +00:00
|
|
|
git submodule update --init addins/riscv-arch-test addins/verilog-ethernet
|
2024-10-16 04:16:21 +00:00
|
|
|
# Free up space on the host machine, either from the container or the host
|
2024-10-15 06:51:23 +00:00
|
|
|
- name: Free Up Storage
|
2024-07-16 07:14:57 +00:00
|
|
|
run: |
|
|
|
|
df -h
|
2024-10-15 06:51:23 +00:00
|
|
|
if [ -z ${{ matrix.image }} ]; then
|
|
|
|
./.github/cli-space-cleanup.sh
|
|
|
|
else
|
|
|
|
nsenter -t 1 -m -u -n -i bash -c "$(cat .github/cli-space-cleanup.sh)"
|
|
|
|
fi
|
2024-07-16 07:14:57 +00:00
|
|
|
df -h
|
2024-10-16 04:16:21 +00:00
|
|
|
# Run main tool chain installation script, either as a user or system wide
|
2024-10-15 06:11:17 +00:00
|
|
|
- name: Install
|
2024-10-15 07:11:09 +00:00
|
|
|
run: |
|
2025-01-05 16:41:02 +00:00
|
|
|
if [ ! -z ${{ matrix.image }} ]; then
|
|
|
|
./bin/wally-tool-chain-install.sh --clean ${{ matrix.riscv_path }}
|
2025-01-05 16:59:35 +00:00
|
|
|
elif [ -z ${{ matrix.user }} ]; then
|
2024-10-15 07:11:09 +00:00
|
|
|
sudo ./bin/wally-tool-chain-install.sh --clean ${{ matrix.riscv_path }}
|
|
|
|
else
|
|
|
|
sudo ./bin/wally-package-install.sh
|
2024-10-15 07:29:05 +00:00
|
|
|
./bin/wally-tool-chain-install.sh --clean ${{ matrix.riscv_path }}
|
2024-10-15 07:11:09 +00:00
|
|
|
fi
|
2024-10-16 04:16:21 +00:00
|
|
|
# Set environment variables for the rest of the job
|
2024-10-15 06:11:17 +00:00
|
|
|
- name: Set Environment Variables
|
2024-10-21 02:06:11 +00:00
|
|
|
if: always()
|
2024-10-15 06:11:17 +00:00
|
|
|
run: |
|
2024-10-15 07:11:09 +00:00
|
|
|
if [ ! -z ${{ matrix.riscv_path }} ]; then
|
|
|
|
sed -i 's,exit 1,export RISCV=${{ matrix.riscv_path }},g' setup.sh
|
|
|
|
fi
|
2024-10-15 06:11:17 +00:00
|
|
|
source setup.sh
|
|
|
|
echo "RISCV=$RISCV" >> "$GITHUB_ENV"
|
2024-10-16 04:16:21 +00:00
|
|
|
# Upload installation logs for debugging
|
2024-10-15 06:11:17 +00:00
|
|
|
- name: Upload Installation Logs
|
2024-08-08 05:02:33 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
if: always()
|
|
|
|
with:
|
2024-10-15 06:11:17 +00:00
|
|
|
name: installation-logs-${{ matrix.name }}
|
2024-10-16 02:30:05 +00:00
|
|
|
path: ${{ env.RISCV }}/logs/
|
2024-10-16 05:26:27 +00:00
|
|
|
# Make riscof and zsbl only as that is the only testsuite used by standard regression
|
2024-08-08 05:02:33 +00:00
|
|
|
- name: make tests
|
2024-07-26 22:21:43 +00:00
|
|
|
run: |
|
|
|
|
source setup.sh
|
2024-10-16 05:26:27 +00:00
|
|
|
make riscof zsbl --jobs $(nproc --ignore 1)
|
2024-10-16 04:16:21 +00:00
|
|
|
# Only the linux-testvectors are needed, so remove the rest of the buildroot to save space
|
2024-10-15 06:11:17 +00:00
|
|
|
- name: Remove Buildroot to Save Space
|
2024-10-12 04:54:28 +00:00
|
|
|
run: |
|
2025-01-05 20:43:40 +00:00
|
|
|
rm -rf $RISCV/buildroot/output/build || sudo rm -rf $RISCV/buildroot/output/build
|
2024-10-12 04:54:28 +00:00
|
|
|
df -h
|
2024-10-16 04:16:21 +00:00
|
|
|
# Run standard regression, skipping distros that are known to be broken with Verilator
|
2024-10-15 06:11:17 +00:00
|
|
|
- name: Regression
|
2024-11-24 04:15:25 +00:00
|
|
|
if: ${{ matrix.regressionFail != true }}
|
2024-08-08 05:02:33 +00:00
|
|
|
run: |
|
|
|
|
source setup.sh
|
|
|
|
regression-wally
|
2024-10-17 07:22:51 +00:00
|
|
|
- name: Lint + wsim Test Only (for distros with broken Verilator sim)
|
2024-11-24 04:15:25 +00:00
|
|
|
if: ${{ matrix.regressionFail == true }}
|
2024-10-16 05:44:19 +00:00
|
|
|
run: |
|
|
|
|
source setup.sh
|
2024-10-17 07:22:51 +00:00
|
|
|
mkdir -p $WALLY/sim/verilator/logs/
|
2024-10-16 05:44:19 +00:00
|
|
|
lint-wally
|
2024-10-16 07:48:27 +00:00
|
|
|
wsim rv32i arch32i --sim verilator | tee $WALLY/sim/verilator/logs/rv32i_arch32i.log
|
2024-10-16 04:16:21 +00:00
|
|
|
# Upload regression logs for debugging
|
2024-08-08 05:02:33 +00:00
|
|
|
- name: Upload regression logs
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
if: always()
|
|
|
|
with:
|
2024-10-15 06:11:17 +00:00
|
|
|
name: regression-logs-${{ matrix.name }}
|
2024-08-08 05:02:33 +00:00
|
|
|
path: ${{ github.workspace }}/sim/verilator/logs/
|