Skip to content
Open
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
72 changes: 72 additions & 0 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copyright 2020-2022 F4PGA Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

name: "Run tests"

inputs:
plugin:
description: "Name of the plugin to run the tests for"
required: true
yosys-version:
description: "Which yosys version to build against ('conda' or branch name)"
required: true

runs:
using: 'composite'
steps:

- uses: actions/setup-python@v2

- name: Install
shell: bash
run: |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest building a container in one step and reusing it for all the jobs, instead of installing all the deps in each jobs. Nevertheless, that can be done in a follow-up PR.

sudo apt-get update
sudo apt-get install git g++-9 build-essential bison flex \
libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot \
pkg-config libboost-system-dev libboost-python-dev \
libboost-filesystem-dev zlib1g-dev clang-format-8 cmake \
gperf autoconf tclsh swig uuid-dev libgoogle-perftools-dev \
default-jre lcov
pip3 install orderedmultidict psutil

- name: Format
shell: bash
run: source .github/workflows/format-check.sh
env:
OS: ${{ runner.os }}

- name: ccache
uses: hendrikmuhs/ccache-action@v1

- name: Install Yosys
shell: bash
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
source .github/workflows/setup.sh
env:
OS: ${{ runner.os }}
YOSYS_VERSION: ${{ inputs.yosys-version }}

- name: Build and test plugins
shell: bash
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
[ "${YOSYS_VERSION}" == "conda" ] && source env/conda/bin/activate yosys-plugins
source .github/workflows/build-and-test.sh
env:
OS: ${{ runner.os }}
PLUGIN_NAME: ${{ inputs.plugin }}
YOSYS_VERSION: ${{ inputs.yosys-version }}
63 changes: 6 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,67 +14,16 @@
#
# SPDX-License-Identifier: Apache-2.0

name: CI tests
name: Plugins builds and tests

on: [push, pull_request]

jobs:

Run-tests:
runs-on: ubuntu-20.04

Run-tests-reusable:
strategy:
fail-fast: false
matrix:
plugin:
- fasm
- xdc
- params
- sdc
- ql-iob
- design_introspection
- integrateinv
- ql-qlf
- systemverilog
- uhdm
- dsp-ff

steps:

- uses: actions/checkout@v2
with:
submodules: recursive

- uses: actions/setup-python@v2

- name: Install
run: |
sudo apt-get update
sudo apt-get install git g++-9 build-essential bison flex \
libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot \
pkg-config libboost-system-dev libboost-python-dev \
libboost-filesystem-dev zlib1g-dev clang-format-8 cmake

- name: Format
run: source .github/workflows/format-check.sh
env:
OS: ${{ runner.os }}

- name: ccache
uses: hendrikmuhs/ccache-action@v1

- name: Install Yosys
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
source .github/workflows/setup.sh
env:
OS: ${{ runner.os }}

- name: Build and test plugins
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
source env/conda/bin/activate yosys-plugins
source .github/workflows/build-and-test.sh
env:
OS: ${{ runner.os }}
PLUGIN_NAME: ${{ matrix.plugin }}
yosys-version: [conda, HEAD, yosys-0.25]
uses: ./.github/workflows/tests.yml
with:
yosys-version: ${{ matrix.yosys-version }}
54 changes: 47 additions & 7 deletions .github/workflows/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,60 @@ end_section
#Install yosys
start_section Install-Yosys
(
echo '================================='
echo 'Making env with Yosys and Surelog'
echo '================================='
make env
source env/conda/bin/activate yosys-plugins
conda list
if [ -z "${YOSYS_VERSION}" ]; then
echo "Missing \${YOSYS_VERSION} env value"
echo "Defaulting to conda yosys"
YOSYS_VERSION="conda"
fi

if [ "${YOSYS_VERSION}" == "conda" ]; then
echo '================================='
echo 'Making env with Yosys and Surelog'
echo '================================='
make env
source env/conda/bin/activate yosys-plugins
conda list
else
PREFIX=${HOME}/.local
echo '=========================================='
echo 'Building Yosys version: "${YOSYS_VERSION}"'
echo '=========================================='
git clone https://github.com/YosysHQ/yosys.git
cd yosys
git checkout "${YOSYS_VERSION}"
make config-gcc
echo -n "PREFIX := $PREFIX" >> Makefile.conf
make -j`nproc`
make install
cd ..
echo '================'
echo 'Building Surelog'
echo '================'
git clone https://github.com/chipsalliance/Surelog.git
cd Surelog
git submodule update --init --recursive
make -j`nproc`
make install PREFIX=$PREFIX
cd ..
echo '================='
echo 'Building iverilog'
echo '================='
git clone https://github.com/steveicarus/iverilog.git
cd iverilog
sh autoconf.sh
./configure --prefix=$PREFIX
make -j`nproc`
make install
cd ..
fi
)
end_section

##########################################################################

start_section Yosys-Version
(
source env/conda/bin/activate yosys-plugins
[ "${YOSYS_VERSION}" == "conda" ] && source env/conda/bin/activate yosys-plugins
echo $(which yosys)
echo $(which yosys-config)
echo $(yosys --version)
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 2020-2022 F4PGA Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

name: CI tests

on:
workflow_call:
inputs:
yosys-version:
required: true
type: string


jobs:
Run-tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
plugin:
- design_introspection
- xdc
- sdc
- fasm
- params
- ql-iob
- integrateinv
- ql-qlf
- systemverilog
- uhdm
- dsp-ff

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: ./.github/actions
with:
plugin: ${{ matrix.plugin }}
yosys-version: ${{ inputs.yosys-version }}