cvw/.github/workflows/install.yml
2024-10-15 20:42:27 -07:00

189 lines
6.0 KiB
YAML

name: Installation
on: [workflow_dispatch, push]
defaults:
run:
shell: bash
jobs:
installation_test:
name: Test installation for ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
# Ubuntu Installations
- name: ubuntu-20.04
os: ubuntu-20.04
container: null
- name: ubuntu-22.04
os: ubuntu-22.04
container: null
- name: ubuntu-24.04
os: ubuntu-24.04
container: null
# Red Hat Installations
- name: rocky-8
os: ubuntu-latest
image: rockylinux:8
- name: rocky-9
os: ubuntu-latest
image: rockylinux:9
- name: almalinux-8
os: ubuntu-latest
image: almalinux:8
- name: almalinux-9
os: ubuntu-latest
image: almalinux:9
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.image }}
options: --privileged --mount type=bind,source=/,target=/host --pid=host --entrypoint /bin/bash
steps:
- name: Install Dependencies for Red Hat
if: ${{ matrix.image != null }}
run: |
dnf install -y sudo git
dnf install curl -y --allowerasing || true
- uses: actions/checkout@v4
- name: Clone Necessary Submodules
run: |
git config --global --add safe.directory '*'
git submodule update --init addins/riscv-arch-test addins/verilog-ethernet
- name: Free Up Storage
run: |
df -h
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
df -h
- name: Install
run: sudo ./bin/wally-tool-chain-install.sh --clean
- name: Set Environment Variables
run: |
source setup.sh
echo "RISCV=$RISCV" >> "$GITHUB_ENV"
- name: Upload Installation Logs
uses: actions/upload-artifact@v4
if: always()
with:
name: installation-logs-${{ matrix.name }}
path: $RISCV/logs/
- name: make tests
run: |
source setup.sh
make riscof --jobs $(nproc --ignore 1)
- name: Remove Buildroot to Save Space
run: |
sudo rm -rf /opt/riscv/buildroot/output/build
df -h
- name: Regression
run: |
source setup.sh
regression-wally
- name: Upload regression logs
uses: actions/upload-artifact@v4
if: always()
with:
name: regression-logs-${{ matrix.name }}
path: ${{ github.workspace }}/sim/verilator/logs/
user_install:
name: Test installation with user permissions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clone Necessary Submodules
run: |
git config --global --add safe.directory '*'
git submodule update --init addins/riscv-arch-test addins/verilog-ethernet
- name: Free up storage
run: |
df -h
./.github/cli-space-cleanup.sh
df -h
- name: install packages with sudo
run: sudo ./bin/wally-package-install.sh
- name: install
run: ./bin/wally-tool-chain-install.sh --clean
- name: Upload installation logs
uses: actions/upload-artifact@v4
if: always()
with:
name: installation-logs-user-install
path: ~/riscv/logs/
- name: make tests
run: |
source setup.sh
make riscof --jobs $(nproc --ignore 1)
- name: check storage
run: |
sudo rm -rf /opt/riscv/buildroot/output/build
df -h
- name: regression
run: |
source setup.sh
regression-wally
- name: Upload regression logs
uses: actions/upload-artifact@v4
if: always()
with:
name: regression-logs-user-install
path: ${{ github.workspace }}/sim/verilator/logs/
custom_location_install:
name: Test installation with custom location ${{ matrix.path }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
path: ["/home/riscv"]
steps:
- name: Unique name for Artifacts
id: prep_artifact_name
run: |
name=$(echo -n "${{ matrix.os }}" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g')
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Clone Necessary Submodules
run: |
git config --global --add safe.directory '*'
git submodule update --init addins/riscv-arch-test addins/verilog-ethernet
- name: Free up storage
run: |
df -h
./.github/cli-space-cleanup.sh
df -h
- name: install
run: sudo ./bin/wally-tool-chain-install.sh --clean ${{ matrix.path }}
- name: Upload instalation logs
uses: actions/upload-artifact@v4
if: always()
with:
name: installation-logs-custom-location-install-${{ env.ARTIFACT_NAME }}
path: ${{ matrix.path }}/logs/
- name: Update setup.sh with new $RISCV location
run: sed -i 's,exit 1,export RISCV=${{ matrix.path }},g' setup.sh
- name: make tests
run: |
source setup.sh
make riscof --jobs $(nproc --ignore 1)
- name: check storage
run: |
sudo rm -rf ${{ matrix.path }}/buildroot/output/build
df -h
- name: regression
run: |
source setup.sh
regression-wally
- name: Upload regression logs
uses: actions/upload-artifact@v4
if: always()
with:
name: regression-logs-custom-location-install-${{ env.ARTIFACT_NAME }}
path: ${{ github.workspace }}/sim/verilator/logs/