diff options
author | Jan Matyas <jan.matyas@codasip.com> | 2023-02-21 16:39:11 +0100 |
---|---|---|
committer | Jan Matyas <jan.matyas@codasip.com> | 2023-02-21 16:42:35 +0100 |
commit | 67cddebde3c7706274d368cbb9044cd917c0875a (patch) | |
tree | 68f1fdbc0b2224d4e72b342acdbbd67e463485a8 | |
parent | 13b0afaf820fa5de0e603c6a65a3884bb01b4c57 (diff) | |
download | riscv-openocd-67cddebde3c7706274d368cbb9044cd917c0875a.zip riscv-openocd-67cddebde3c7706274d368cbb9044cd917c0875a.tar.gz riscv-openocd-67cddebde3c7706274d368cbb9044cd917c0875a.tar.bz2 |
Several tweaks and experiments with Gitlab CI
- made the runner name explicit (ubuntu-22.04 instead of ubuntu-latest)
- use checkout action v3 (not v2) - silences a Github warning
- attempted to cache dependencies
- reordered the actions a bit so that the cached items are handled first
- installed all dependencies to /opt/riscv so that they can be cached more easily as a bulk
Change-Id: Icc9c31b20d6302ca378cfafb4f7b283b6e481520
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
-rw-r--r-- | .github/workflows/spike-openocd-tests.yml | 73 |
1 files changed, 42 insertions, 31 deletions
diff --git a/.github/workflows/spike-openocd-tests.yml b/.github/workflows/spike-openocd-tests.yml index 0f2bca3..fca24f8 100644 --- a/.github/workflows/spike-openocd-tests.yml +++ b/.github/workflows/spike-openocd-tests.yml @@ -12,49 +12,60 @@ on: pull_request jobs: test: name: Test debug (Ubuntu) - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - name: Install Dependencies - run: | - sudo apt install build-essential device-tree-compiler - -# - name: Download OpenOCD -# run: | -# git clone --recurse-submodules https://github.com/riscv/riscv-openocd.git -# cd riscv-openocd -# git checkout 43ea20dfbb6c815004a51106a3b2009d7f6c4940 + - name: Cache dependencies + id: cache-deps + uses: actions/cache@v3 + with: + path: /opt/riscv - - name: Build OpenOCD - run: | - #cd riscv-openocd - ./bootstrap - ./configure - make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" - ls -l src/openocd - - - name: Download Toolchain + - if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }} + name: Download Toolchain run: wget --progress=dot:giga https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v12.2.0-1/xpack-riscv-none-elf-gcc-12.2.0-1-linux-x64.tar.gz - - name: Install Toolchain - run: tar zxf xpack-riscv-none-elf-gcc-12.2.0-1-linux-x64.tar.gz + - if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }} + name: Install Toolchain + run: tar zxf --strip-components=1 -C /opt/riscv xpack-riscv-none-elf-gcc-12.2.0-1-linux-x64.tar.gz - - name: Download spike + - if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }} + name: Download Spike source run: | git clone --recurse-submodules https://github.com/riscv-software-src/riscv-isa-sim #cd riscv-isa-sim #git checkout 43ea20dfbb6c815004a51106a3b2009d7f6c4940 - - name: Build Spike + - if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }} + name: Install Spike build dependencies + run: | + sudo apt install build-essential device-tree-compiler + + - if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }} + name: Build Spike run: | cd riscv-isa-sim mkdir build install cd build - ../configure --prefix=`pwd`/install + ../configure --prefix=/opt/riscv make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" make install + - name: Build OpenOCD + run: | + #cd riscv-openocd + ./bootstrap + ./configure --prefix=/opt/riscv + make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" + ls -l src/openocd + +# - name: Download OpenOCD +# run: | +# git clone --recurse-submodules https://github.com/riscv/riscv-openocd.git +# cd riscv-openocd +# git checkout 43ea20dfbb6c815004a51106a3b2009d7f6c4940 + - name: Download Tests run: | git clone --recurse-submodules https://github.com/riscv-software-src/riscv-tests.git @@ -65,12 +76,12 @@ jobs: run: | cd riscv-tests/debug ./gdbserver.py targets/RISC-V/spike32.py --print-failures \ - --gcc $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gcc \ - --gdb $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gdb \ - --sim_cmd $GITHUB_WORKSPACE/riscv-isa-sim/build/install/bin/spike \ + --gcc /opt/riscv/bin/riscv-none-elf-gcc \ + --gdb /opt/riscv/bin/riscv-none-elf-gdb \ + --sim_cmd /opt/riscv/bin/spike \ --server_cmd $GITHUB_WORKSPACE/src/openocd ./gdbserver.py targets/RISC-V/spike64-2.py --print-failures \ - --gcc $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gcc \ - --gdb $GITHUB_WORKSPACE/xpack-riscv-none-elf-gcc-12.2.0-1/bin/riscv-none-elf-gdb \ - --sim_cmd $GITHUB_WORKSPACE/riscv-isa-sim/build/install/bin/spike \ + --gcc /opt/riscv/bin/riscv-none-elf-gcc \ + --gdb /opt/riscv/bin/riscv-none-elf-gdb \ + --sim_cmd /opt/riscv/bin/spike \ --server_cmd $GITHUB_WORKSPACE/src/openocd |