Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] add workflow 'Containers' #116

Merged
merged 3 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/impl.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM gcr.io/hdl-containers/debian/buster/impl

ENV GHDL_PLUGIN_MODULE=ghdl
16 changes: 16 additions & 0 deletions .github/sim.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM gcr.io/hdl-containers/debian/buster/sim/osvb

RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
g++ \
git \
make \
time \
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /opt/riscv \
&& curl -fsSL https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-2.0.0/riscv32-unknown-elf.gcc-10.2.0.rv32i.ilp32.newlib.tar.gz | \
tar -xzf - -C /opt/riscv \
&& ls -al /opt/riscv

ENV PATH $PATH:/opt/riscv/bin
40 changes: 40 additions & 0 deletions .github/workflows/Containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Containers

on:
push:
paths:
- '.github/*.dockerfile'
schedule:
- cron: '0 0 * * 5'
workflow_dispatch:

jobs:

Container:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- impl
- sim
name: '🛳️ ${{ matrix.image }}'

steps:

- name: '🧰 Repository Checkout'
uses: actions/checkout@v2

- name: '⛴️ Build neorv32/${{ matrix.image }}'
run: docker build -t ghcr.io/stnolting/neorv32/${{ matrix.image }} - < .github/${{ matrix.image }}.dockerfile

- name: '🔑 Login to ghcr.io'
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: gha
password: ${{ github.token }}

- name: '🛰️ Push image to ghcr.io'
run: docker push ghcr.io/stnolting/neorv32/${{ matrix.image }}
6 changes: 2 additions & 4 deletions .github/workflows/Implementation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,14 @@ jobs:
matrix:
include: ${{ fromJson(needs.Matrix.outputs.matrix) }}
name: '🛳️ All-in-one | ${{ matrix.board }} · ${{ matrix.design }}'
env:
GHDL_PLUGIN_MODULE: ghdl

steps:

- name: '🧰 Repository Checkout'
uses: actions/checkout@v2

- name: '⚙️ Generate ${{ matrix.board }} ${{ matrix.design }} bitstream'
uses: docker://ghcr.io/hdl/debian-buster/impl
- name: '🚧 Generate ${{ matrix.board }} ${{ matrix.design }} bitstream'
uses: docker://ghcr.io/stnolting/neorv32/impl
with:
args: make -C setups/examples BOARD=${{ matrix.board }} ${{ matrix.design }}

Expand Down
56 changes: 17 additions & 39 deletions .github/workflows/Processor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,15 @@ jobs:
- name: '🧰 Repository Checkout'
uses: actions/checkout@v2

- name: '🔧 Setup Environment Variables'
run: |
echo "$GITHUB_WORKSPACE/riscv/bin" >> $GITHUB_PATH
echo $GITHUB_WORKSPACE

- name: '⚙️ Setup RISC-V GCC'
run: |
mkdir riscv
curl -fsSL https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-2.0.0/riscv32-unknown-elf.gcc-10.2.0.rv32i.ilp32.newlib.tar.gz | \
tar -xzf - -C riscv
ls -al riscv

- name: '⚙️ Setup GHDL Simulator'
uses: ghdl/setup-ghdl-ci@nightly
with:
backend: llvm

- name: '🚧 Run Software Framework Tests'
run: ./sw/example/processor_check/check.sh
uses: docker://ghcr.io/stnolting/neorv32/sim
with:
args: ./sw/example/processor_check/check.sh

- name: '🚧 Run Processor Hardware Tests with shell script'
run: ./sim/ghdl.sh
uses: docker://ghcr.io/stnolting/neorv32/sim
with:
args: ./sim/ghdl.sh


VUnit-Container:
Expand All @@ -64,27 +51,17 @@ jobs:
- name: '🧰 Repository Checkout'
uses: actions/checkout@v2

- name: '🔧 Setup Environment Variables'
run: |
echo "$GITHUB_WORKSPACE/riscv/bin" >> $GITHUB_PATH
echo $GITHUB_WORKSPACE

- name: '⚙️ Setup RISC-V GCC'
run: |
mkdir riscv
curl -fsSL https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-2.0.0/riscv32-unknown-elf.gcc-10.2.0.rv32i.ilp32.newlib.tar.gz | \
tar -xzf - -C riscv
ls -al riscv

- name: '⚙️ Build and install Processor Check software'
run: |
make -C sw/example/processor_check \
clean_all \
USER_FLAGS+=-DRUN_CHECK \
USER_FLAGS+=-DUART0_SIM_MODE \
USER_FLAGS+=-DSUPPRESS_OPTIONAL_UART_PRINT \
MARCH=-march=rv32imac \
info \
uses: docker://ghcr.io/stnolting/neorv32/sim
with:
args: >-
make -C sw/example/processor_check
clean_all
USER_FLAGS+=-DRUN_CHECK
USER_FLAGS+=-DUART0_SIM_MODE
USER_FLAGS+=-DSUPPRESS_OPTIONAL_UART_PRINT
MARCH=-march=rv32imac
info
all

- name: '📤 Archive Processor Check application image'
Expand All @@ -96,4 +73,5 @@ jobs:
- name: '🚧 Run Processor Hardware Tests with VUnit'
uses: VUnit/vunit_action@master
with:
image: ghcr.io/stnolting/neorv32/sim
cmd: ./sim/run.py --ci-mode -v