Skip to content

Commit

Permalink
Fix scripts running in containers
Browse files Browse the repository at this point in the history
  • Loading branch information
wsipak committed Oct 11, 2024
1 parent 59ff377 commit ab4338e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-openocd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
submodules: recursive

- name: install SiteSpawner package
shell: bash
run: |
python3 -m venv .venv
.venv/bin/python3 -m pip install tools/SiteSpawner
Expand All @@ -52,6 +53,7 @@ jobs:
python3 -m pip install tools/SiteSpawner
- name: Build verilated simulation
shell: bash
run: |
export PATH=/opt/verilator/bin:/opt/openocd/bin:$PATH
export RV_ROOT=$(pwd)
Expand All @@ -64,6 +66,7 @@ jobs:
-f ${RV_ROOT}/testbench/openocd_scripts/jtag_cg.tcl
- name: Prepare coverage data
shell: bash
run: |
export PATH=/opt/verilator/bin:$PATH
export RV_ROOT=$(pwd)
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
submodules: recursive

- name: install SiteSpawner package
shell: bash
run: |
python3 -m venv .venv
.venv/bin/python3 -m pip install tools/SiteSpawner
Expand All @@ -68,6 +69,7 @@ jobs:
python3 -m pip install tools/SiteSpawner
- name: Setup environment
shell: bash
run: |
echo "/opt/verilator/bin" >> $GITHUB_PATH
RV_ROOT=`pwd`
Expand All @@ -78,13 +80,16 @@ jobs:
echo "TEST_PATH=$TEST_PATH" >> $GITHUB_ENV
- name: Run tests
shell: bash
run: |
export PATH=/opt/verilator/bin:$PATH
export RV_ROOT=`pwd`
.github/scripts/run_regression_test.sh $TEST_PATH ${{ matrix.bus }} ${{ matrix.test}} ${{ matrix.coverage }} ${{ matrix.priv }}
- name: Prepare coverage data
shell: bash
run: |
source .venv/bin/activate
sis -d convert --dat-dir ${TEST_PATH}/
mkdir -p results
mv ${TEST_PATH}/coverage.info \
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test-riscof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
submodules: recursive

- name: install SiteSpawner package
shell: bash
run: |
python3 -m venv .venv
.venv/bin/python3 -m pip install tools/SiteSpawner
Expand All @@ -80,6 +81,7 @@ jobs:
pip3 install git+https://github.com/riscv/riscof@a25e315
- name: Clone tests
shell: bash
run: |
mkdir -p riscof
pushd riscof
Expand All @@ -90,6 +92,7 @@ jobs:
popd
- name: Configure RISCOF
shell: bash
run: |
pushd riscof
# Copy RISCOF configuration
Expand All @@ -101,6 +104,7 @@ jobs:
popd
- name: Build VeeR model
shell: bash
run: |
export PATH=/opt/verilator/bin:$PATH
export RV_ROOT=`pwd`
Expand All @@ -114,6 +118,7 @@ jobs:
popd
- name: Run tests, collect coverage
shell: bash
run: |
export PATH=/opt/verilator/bin:/opt/spike/bin:$PATH
pushd riscof
Expand All @@ -123,15 +128,17 @@ jobs:
popd
- name: Prepare coverage data
shell: bash
run: |
export PATH=/opt/verilator/bin:$PATH
sis -d convert --dat-dir riscof/coverage/
mv riscof/coverage/coverage.info \
riscof/coverage/coverage_riscof_${{matrix.priv}}_${{ matrix.coverage }}.info
- name: Prepare report
shell: bash
run: |
PYTEST_STYLE_SRC_DIR=${{ github.workspace }}/.github/scripts/pytest/
PYTEST_STYLE_SRC_DIR=$(pwd)/.github/scripts/pytest/
PYTEST_CSS=${PYTEST_STYLE_SRC_DIR}/css/styles.css
pushd riscof/riscof_work
bash ${PYTEST_STYLE_SRC_DIR}/style_pytest_report.sh ${PYTEST_STYLE_SRC_DIR} . report.html
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-riscv-dv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:

- name: Generate code (pyflow)
if: steps.cache-code.outputs.cache-hit != 'true' && matrix.version == 'pyflow'
shell: bash
run: |
export RV_ROOT=`realpath .`
pushd tools/riscv-dv
Expand Down Expand Up @@ -141,6 +142,7 @@ jobs:
# As of July 9th, 2024 `ubuntu:latest` comes with riscv64-unknown-elf-gcc
# 10.0.2. We need a newer version for bitmanip extension support.
- name: Install cross-compiler
shell: bash
run: |
echo "deb http://archive.ubuntu.com/ubuntu/ noble main universe" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt -qqy update && sudo apt -qqy --no-install-recommends install \
Expand Down Expand Up @@ -168,6 +170,7 @@ jobs:
submodules: recursive

- name: install SiteSpawner package
shell: bash
run: |
python3 -m venv .venv
.venv/bin/python3 -m pip install tools/SiteSpawner
Expand Down Expand Up @@ -204,6 +207,7 @@ jobs:
fail-on-cache-miss: true

- name: Run test
shell: bash
run: |
export PATH=/opt/verilator/bin:$PATH
export RV_ROOT=`realpath .`
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/test-uarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
submodules: recursive

- name: Setup environment
shell: bash
run: |
RV_ROOT=`pwd`
echo "RV_ROOT=$RV_ROOT" >> $GITHUB_ENV
Expand All @@ -24,9 +25,13 @@ jobs:
TEST_PATH=$RV_ROOT/verification/block
echo "TEST_PATH=$TEST_PATH" >> $GITHUB_ENV
pip3 install nox
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install nox
- name: Lint
shell: bash
run: |
source .venv/bin/activate
pushd ${TEST_PATH}
nox -s test_lint
popd
Expand Down Expand Up @@ -63,15 +68,16 @@ jobs:
submodules: recursive

- name: install SiteSpawner package
shell: bash
run: |
python3 -m venv .venv
.venv/bin/python3 -m pip install tools/SiteSpawner
source .venv/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
python3 -m pip install tools/SiteSpawner
python3 -m pip install meson nox
- name: Setup Cache Metadata
id: cache_metadata
shell: bash
run: |
date=$(date +"%Y_%m_%d")
time=$(date +"%Y%m%d_%H%M%S_%N")
Expand Down Expand Up @@ -110,6 +116,7 @@ jobs:
sudo cpanm Bit::Vector
- name: Setup environment
shell: bash
run: |
echo "/opt/verilator/bin" >> $GITHUB_PATH
RV_ROOT=`pwd`
Expand All @@ -128,17 +135,19 @@ jobs:
# Fix random generator seed
echo "RANDOM_SEED=1377424946" >> $GITHUB_ENV
pip3 install meson nox
- name: Run ${{ matrix.test }}
shell: bash
run: |
source .venv/bin/activate
pushd ${TEST_PATH}
nox -s ${TEST_NAME}_verify
popd
- name: Prepare coverage data
shell: bash
run: |
export PATH=/opt/verilator/bin:$PATH
source .venv/bin/activate
sis -d convert --dat-dir ${TEST_PATH}/${TEST_NAME}/
mkdir -p results
mv ${TEST_PATH}/${TEST_NAME}/*.info results/
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/test-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
submodules: recursive

- name: install SiteSpawner package
shell: bash
run: |
python3 -m venv .venv
.venv/bin/python3 -m pip install tools/SiteSpawner
source .venv/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
python3 -m pip install tools/SiteSpawner
- name: Setup Cache Metadata
id: cache_metadata
shell: bash
run: |
date=$(date +"%Y_%m_%d")
time=$(date +"%Y%m%d_%H%M%S_%N")
Expand Down Expand Up @@ -69,6 +69,7 @@ jobs:
sudo cpanm Bit::Vector
- name: Setup environment
shell: bash
run: |
echo "/opt/verilator/bin" >> $GITHUB_PATH
RV_ROOT=`pwd`
Expand All @@ -78,11 +79,14 @@ jobs:
TEST_PATH=$RV_ROOT/verification/top/${{ matrix.test }}
echo "TEST_PATH=$TEST_PATH" >> $GITHUB_ENV
- name: Run ${{ matrix.test }}
shell: bash
run: |
source .venv/bin/activate
pip3 install meson
pip3 install -r $RV_ROOT/verification/top/requirements.txt
PYTEST_STYLE_SRC_DIR=${{ github.workspace }}/.github/scripts/pytest/
PYTEST_STYLE_SRC_DIR=$RV_ROOT/.github/scripts/pytest/
PYTEST_CSS=${PYTEST_STYLE_SRC_DIR}/css/styles.css
HTML_FILE=${{ matrix.test }}_${{ matrix.COVERAGE }}.html
pushd ${TEST_PATH}
Expand All @@ -91,18 +95,22 @@ jobs:
popd
- name: Prepare pytest-html data
shell: bash
run: |
pushd ${{ github.workspace }}
source .venv/bin/activate
pushd $RV_ROOT
WEBPAGE_DIR=webpage_${{ matrix.test }}_${{ matrix.COVERAGE }}
mkdir -p $WEBPAGE_DIR
mv ${TEST_PATH}/${{ matrix.test }}_${{ matrix.COVERAGE }}.html $WEBPAGE_DIR
mv ${TEST_PATH}/assets $WEBPAGE_DIR
JS_SCRIPT_DIR=${{ github.workspace }}/.github/scripts/pytest/script
JS_SCRIPT_DIR=$RV_ROOT/.github/scripts/pytest/script
mv $JS_SCRIPT_DIR $WEBPAGE_DIR
popd
- name: Prepare coverage data
shell: bash
run: |
source .venv/bin/activate
export PATH=/opt/verilator/bin:$PATH
sis -d convert --dat-dir ${TEST_PATH}
mkdir -p results
Expand Down

0 comments on commit ab4338e

Please sign in to comment.