mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Merge pull request #4183 from YosysHQ/krys/refactor-workflows
CI Improvements
This commit is contained in:
commit
75f01ccee8
33
.github/actions/setup-build-env/action.yml
vendored
Normal file
33
.github/actions/setup-build-env/action.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
name: Build environment setup
|
||||||
|
description: Configure build env for Yosys builds
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Install Linux Dependencies
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
|
||||||
|
|
||||||
|
- name: Install macOS Dependencies
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install bison flex gawk libffi pkg-config bash autoconf
|
||||||
|
|
||||||
|
- name: Linux runtime environment
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH
|
||||||
|
echo "procs=$(nproc)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: macOS runtime environment
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "${{ github.workspace }}/.local/bin" >> $GITHUB_PATH
|
||||||
|
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
|
||||||
|
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
|
||||||
|
echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
|
172
.github/workflows/test-build.yml
vendored
Normal file
172
.github/workflows/test-build.yml
vendored
Normal file
|
@ -0,0 +1,172 @@
|
||||||
|
name: Build and run tests
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre_job:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||||
|
steps:
|
||||||
|
- id: skip_check
|
||||||
|
uses: fkirc/skip-duplicate-actions@v5
|
||||||
|
with:
|
||||||
|
paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
|
||||||
|
# cancel previous builds if a new commit is pushed
|
||||||
|
cancel_others: 'true'
|
||||||
|
# only run on push *or* pull_request, not both
|
||||||
|
concurrent_skipping: 'same_content_newer'
|
||||||
|
|
||||||
|
build-yosys:
|
||||||
|
name: Reusable build
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs: pre_job
|
||||||
|
if: needs.pre_job.outputs.should_skip != 'true'
|
||||||
|
env:
|
||||||
|
CC: clang
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- name: Checkout Yosys
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Setup environment
|
||||||
|
uses: ./.github/actions/setup-build-env
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
make -f ../Makefile config-$CC
|
||||||
|
make -f ../Makefile -j$procs
|
||||||
|
|
||||||
|
- name: Log yosys-config output
|
||||||
|
run: |
|
||||||
|
./yosys-config || true
|
||||||
|
|
||||||
|
- name: Log yosys-config output
|
||||||
|
run: |
|
||||||
|
./yosys-config || true
|
||||||
|
|
||||||
|
- name: Compress build
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd build
|
||||||
|
tar -cvf ../build.tar share/ yosys yosys-*
|
||||||
|
|
||||||
|
- name: Store build artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-${{ matrix.os }}
|
||||||
|
path: build.tar
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
test-yosys:
|
||||||
|
name: Run tests
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs: [build-yosys, pre_job]
|
||||||
|
if: needs.pre_job.outputs.should_skip != 'true'
|
||||||
|
env:
|
||||||
|
CC: clang
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- name: Checkout Yosys
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup environment
|
||||||
|
uses: ./.github/actions/setup-build-env
|
||||||
|
|
||||||
|
- name: Get iverilog
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/steveicarus/iverilog.git
|
||||||
|
cd iverilog
|
||||||
|
echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Cache iverilog
|
||||||
|
id: cache-iverilog
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .local/
|
||||||
|
key: ${{ matrix.os }}-${{ env.IVERILOG_GIT }}
|
||||||
|
|
||||||
|
- name: Build iverilog
|
||||||
|
if: steps.cache-iverilog.outputs.cache-hit != 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p ${{ github.workspace }}/.local/
|
||||||
|
cd iverilog
|
||||||
|
autoconf
|
||||||
|
CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local
|
||||||
|
make -j$procs
|
||||||
|
make install
|
||||||
|
|
||||||
|
- name: Download build artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-${{ matrix.os }}
|
||||||
|
|
||||||
|
- name: Uncompress build
|
||||||
|
shell: bash
|
||||||
|
run:
|
||||||
|
tar -xvf build.tar
|
||||||
|
|
||||||
|
- name: Log yosys-config output
|
||||||
|
run: |
|
||||||
|
./yosys-config || true
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
make -j$procs test TARGETS= EXTRA_TARGETS= CONFIG=$CC
|
||||||
|
|
||||||
|
- name: Report errors
|
||||||
|
if: ${{ failure() }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
find tests/**/*.err -print -exec cat {} \;
|
||||||
|
|
||||||
|
test-docs:
|
||||||
|
name: Run docs tests
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs: [build-yosys, pre_job]
|
||||||
|
if: needs.pre_job.outputs.should_skip != 'true'
|
||||||
|
env:
|
||||||
|
CC: clang
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- name: Checkout Yosys
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup environment
|
||||||
|
uses: ./.github/actions/setup-build-env
|
||||||
|
|
||||||
|
- name: Download build artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: build-${{ matrix.os }}
|
||||||
|
|
||||||
|
- name: Uncompress build
|
||||||
|
shell: bash
|
||||||
|
run:
|
||||||
|
tar -xvf build.tar
|
||||||
|
|
||||||
|
- name: Log yosys-config output
|
||||||
|
run: |
|
||||||
|
./yosys-config || true
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
make -C docs test -j${{ env.procs }}
|
79
.github/workflows/test-compile.yml
vendored
Normal file
79
.github/workflows/test-compile.yml
vendored
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
name: Compiler testing
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre_job:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||||
|
steps:
|
||||||
|
- id: skip_check
|
||||||
|
uses: fkirc/skip-duplicate-actions@v5
|
||||||
|
with:
|
||||||
|
paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
|
||||||
|
# cancel previous builds if a new commit is pushed
|
||||||
|
cancel_others: 'true'
|
||||||
|
# only run on push *or* pull_request, not both
|
||||||
|
concurrent_skipping: 'same_content_newer'
|
||||||
|
|
||||||
|
test-compile:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs: pre_job
|
||||||
|
if: needs.pre_job.outputs.should_skip != 'true'
|
||||||
|
env:
|
||||||
|
CXXFLAGS: ${{ startsWith(matrix.compiler, 'gcc') && '-Wp,-D_GLIBCXX_ASSERTIONS' || ''}}
|
||||||
|
CC_SHORT: ${{ startsWith(matrix.compiler, 'gcc') && 'gcc' || 'clang' }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
compiler:
|
||||||
|
# oldest supported
|
||||||
|
- 'clang-14'
|
||||||
|
- 'gcc-10'
|
||||||
|
# newest
|
||||||
|
- 'clang'
|
||||||
|
- 'gcc'
|
||||||
|
include:
|
||||||
|
# macOS
|
||||||
|
- os: macos-13
|
||||||
|
compiler: 'clang'
|
||||||
|
# oldest clang not available on ubuntu-latest
|
||||||
|
- os: ubuntu-22.04
|
||||||
|
compiler: 'clang-11'
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- name: Checkout Yosys
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Setup environment
|
||||||
|
uses: ./.github/actions/setup-build-env
|
||||||
|
|
||||||
|
- name: Setup Cpp
|
||||||
|
uses: aminya/setup-cpp@v1
|
||||||
|
with:
|
||||||
|
compiler: ${{ matrix.compiler }}
|
||||||
|
|
||||||
|
- name: Tool versions
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
$CC --version
|
||||||
|
$CXX --version
|
||||||
|
|
||||||
|
# minimum standard
|
||||||
|
- name: Build C++11
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
make config-$CC_SHORT
|
||||||
|
make -j$procs CXXSTD=c++11 compile-only
|
||||||
|
|
||||||
|
# maximum standard, only on newest compilers
|
||||||
|
- name: Build C++20
|
||||||
|
if: ${{ matrix.compiler == 'clang' || matrix.compiler == 'gcc'}}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
make config-$CC_SHORT
|
||||||
|
make -j$procs CXXSTD=c++20 compile-only
|
58
.github/workflows/test-docs.yml
vendored
58
.github/workflows/test-docs.yml
vendored
|
@ -1,58 +0,0 @@
|
||||||
name: Build and test doc code samples
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pre_job:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
|
||||||
steps:
|
|
||||||
- id: skip_check
|
|
||||||
uses: fkirc/skip-duplicate-actions@v5
|
|
||||||
with:
|
|
||||||
# cancel previous builds if a new commit is pushed
|
|
||||||
cancel_others: 'true'
|
|
||||||
# only run on push *or* pull_request, not both
|
|
||||||
concurrent_skipping: 'same_content_newer'
|
|
||||||
|
|
||||||
test-docs:
|
|
||||||
needs: pre_job
|
|
||||||
if: needs.pre_job.outputs.should_skip != 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Install Dependencies
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
|
|
||||||
|
|
||||||
- name: Setup GCC
|
|
||||||
uses: Dup4/actions-setup-gcc@v1
|
|
||||||
|
|
||||||
- name: Runtime environment
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
WORKSPACE: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
|
|
||||||
echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH
|
|
||||||
echo "procs=$(nproc)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Checkout Yosys
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- name: Build yosys
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
make config-gcc
|
|
||||||
make -j${{ env.procs }}
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
make -C docs test -j${{ env.procs }}
|
|
147
.github/workflows/test-linux.yml
vendored
147
.github/workflows/test-linux.yml
vendored
|
@ -1,147 +0,0 @@
|
||||||
name: Build and run tests (Linux)
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pre_job:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
|
||||||
steps:
|
|
||||||
- id: skip_check
|
|
||||||
uses: fkirc/skip-duplicate-actions@v5
|
|
||||||
with:
|
|
||||||
paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
|
|
||||||
# cancel previous builds if a new commit is pushed
|
|
||||||
cancel_others: 'true'
|
|
||||||
# only run on push *or* pull_request, not both
|
|
||||||
concurrent_skipping: 'same_content_newer'
|
|
||||||
|
|
||||||
test-linux:
|
|
||||||
needs: pre_job
|
|
||||||
if: needs.pre_job.outputs.should_skip != 'true'
|
|
||||||
runs-on: ${{ matrix.os.id }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- { id: ubuntu-20.04, name: focal }
|
|
||||||
compiler:
|
|
||||||
- 'clang-12'
|
|
||||||
- 'gcc-11'
|
|
||||||
cpp_std:
|
|
||||||
- 'c++11'
|
|
||||||
- 'c++14'
|
|
||||||
- 'c++17'
|
|
||||||
- 'c++20'
|
|
||||||
include:
|
|
||||||
# Limit the older compilers to C++11 mode
|
|
||||||
- os: { id: ubuntu-20.04, name: focal }
|
|
||||||
compiler: 'clang-11'
|
|
||||||
cpp_std: 'c++11'
|
|
||||||
- os: { id: ubuntu-20.04, name: focal }
|
|
||||||
compiler: 'gcc-10'
|
|
||||||
cpp_std: 'c++11'
|
|
||||||
fail-fast: false
|
|
||||||
steps:
|
|
||||||
- name: Install Dependencies
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install gperf build-essential bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev
|
|
||||||
|
|
||||||
- name: Setup GCC
|
|
||||||
if: startsWith(matrix.compiler, 'gcc')
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
CXX=${CC/#gcc/g++}
|
|
||||||
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install $CC $CXX
|
|
||||||
echo "CC=$CC" >> $GITHUB_ENV
|
|
||||||
echo "CXX=$CXX" >> $GITHUB_ENV
|
|
||||||
echo "CXXFLAGS=-Wp,-D_GLIBCXX_ASSERTIONS" >> $GITHUB_ENV
|
|
||||||
env:
|
|
||||||
CC: ${{ matrix.compiler }}
|
|
||||||
|
|
||||||
- name: Setup Clang
|
|
||||||
if: startsWith(matrix.compiler, 'clang')
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
wget https://apt.llvm.org/llvm-snapshot.gpg.key
|
|
||||||
sudo apt-key add llvm-snapshot.gpg.key
|
|
||||||
rm llvm-snapshot.gpg.key
|
|
||||||
sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os.name }}/ llvm-toolchain-${{ matrix.os.name }} main"
|
|
||||||
sudo apt-get update
|
|
||||||
CXX=${CC/#clang/clang++}
|
|
||||||
sudo apt-get install $CC $CXX
|
|
||||||
echo "CC=$CC" >> $GITHUB_ENV
|
|
||||||
echo "CXX=$CXX" >> $GITHUB_ENV
|
|
||||||
env:
|
|
||||||
CC: ${{ matrix.compiler }}
|
|
||||||
|
|
||||||
- name: Runtime environment
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
WORKSPACE: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
|
|
||||||
echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH
|
|
||||||
echo "procs=$(nproc)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Tool versions
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
$CC --version
|
|
||||||
$CXX --version
|
|
||||||
|
|
||||||
- name: Checkout Yosys
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- name: Get iverilog
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
git clone https://github.com/steveicarus/iverilog.git
|
|
||||||
cd iverilog
|
|
||||||
echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Cache iverilog
|
|
||||||
id: cache-iverilog
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: .local/
|
|
||||||
key: ${{ matrix.os.id }}-${{ env.IVERILOG_GIT }}
|
|
||||||
|
|
||||||
- name: Build iverilog
|
|
||||||
if: steps.cache-iverilog.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p $GITHUB_WORKSPACE/.local/
|
|
||||||
cd iverilog
|
|
||||||
autoconf
|
|
||||||
CC=gcc CXX=g++ ./configure --prefix=$GITHUB_WORKSPACE/.local
|
|
||||||
make -j${{ env.procs }}
|
|
||||||
make install
|
|
||||||
|
|
||||||
- name: Build yosys
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
make config-${CC%%-*}
|
|
||||||
make -j${{ env.procs }} CXXSTD=${{ matrix.cpp_std }} CC=$CC CXX=$CC LD=$CC
|
|
||||||
|
|
||||||
- name: Store build artifact
|
|
||||||
if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'gcc-11')
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: compiled-yosys
|
|
||||||
path: yosys
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
if: (matrix.cpp_std == 'c++11') && (matrix.compiler == 'gcc-11')
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
make -j${{ env.procs }} test CXXSTD=${{ matrix.cpp_std }} CC=$CC CXX=$CC LD=$CC
|
|
||||||
|
|
||||||
- name: Log yosys-config output
|
|
||||||
run: |
|
|
||||||
./yosys-config || true
|
|
92
.github/workflows/test-macos.yml
vendored
92
.github/workflows/test-macos.yml
vendored
|
@ -1,92 +0,0 @@
|
||||||
name: Build and run tests (macOS)
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pre_job:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
|
||||||
steps:
|
|
||||||
- id: skip_check
|
|
||||||
uses: fkirc/skip-duplicate-actions@v5
|
|
||||||
with:
|
|
||||||
paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]'
|
|
||||||
# cancel previous builds if a new commit is pushed
|
|
||||||
cancel_others: 'true'
|
|
||||||
# only run on push *or* pull_request, not both
|
|
||||||
concurrent_skipping: 'same_content_newer'
|
|
||||||
|
|
||||||
test-macos:
|
|
||||||
needs: pre_job
|
|
||||||
if: needs.pre_job.outputs.should_skip != 'true'
|
|
||||||
runs-on: ${{ matrix.os.id }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os:
|
|
||||||
- { id: macos-13, name: 'Ventura' }
|
|
||||||
cpp_std:
|
|
||||||
- 'c++11'
|
|
||||||
- 'c++17'
|
|
||||||
fail-fast: false
|
|
||||||
steps:
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: |
|
|
||||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install bison flex gawk libffi pkg-config bash
|
|
||||||
|
|
||||||
- name: Runtime environment
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
WORKSPACE: ${{ github.workspace }}
|
|
||||||
run: |
|
|
||||||
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
|
|
||||||
echo "$GITHUB_WORKSPACE/.local/bin" >> $GITHUB_PATH
|
|
||||||
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
|
|
||||||
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
|
|
||||||
echo "procs=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Tool versions
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cc --version
|
|
||||||
|
|
||||||
- name: Checkout Yosys
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- name: Get iverilog
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
git clone https://github.com/steveicarus/iverilog.git
|
|
||||||
cd iverilog
|
|
||||||
echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Cache iverilog
|
|
||||||
id: cache-iverilog
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: .local/
|
|
||||||
key: ${{ matrix.os.id }}-${{ env.IVERILOG_GIT }}
|
|
||||||
|
|
||||||
- name: Build iverilog
|
|
||||||
if: steps.cache-iverilog.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p $GITHUB_WORKSPACE/.local/
|
|
||||||
cd iverilog
|
|
||||||
autoconf
|
|
||||||
CC=gcc CXX=g++ ./configure --prefix=$GITHUB_WORKSPACE/.local/
|
|
||||||
make -j${{ env.procs }}
|
|
||||||
make install
|
|
||||||
|
|
||||||
- name: Build yosys
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
make config-clang
|
|
||||||
make -j${{ env.procs }} CXXSTD=${{ matrix.cpp_std }} CC=cc CXX=cc LD=cc
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
if: matrix.cpp_std == 'c++11'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
make -j${{ env.procs }} test CXXSTD=${{ matrix.cpp_std }} CC=cc CXX=cc LD=cc
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -45,4 +45,3 @@ __pycache__
|
||||||
/tests/unit/bintest/
|
/tests/unit/bintest/
|
||||||
/tests/unit/objtest/
|
/tests/unit/objtest/
|
||||||
/tests/ystests
|
/tests/ystests
|
||||||
/build
|
|
||||||
|
|
10
Makefile
10
Makefile
|
@ -687,6 +687,12 @@ top-all: $(TARGETS) $(EXTRA_TARGETS)
|
||||||
@echo " Build successful."
|
@echo " Build successful."
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
||||||
|
.PHONY: compile-only
|
||||||
|
compile-only: $(OBJS) $(GENFILES) $(EXTRA_TARGETS)
|
||||||
|
@echo ""
|
||||||
|
@echo " Compile successful."
|
||||||
|
@echo ""
|
||||||
|
|
||||||
$(PROGRAM_PREFIX)yosys$(EXE): $(OBJS)
|
$(PROGRAM_PREFIX)yosys$(EXE): $(OBJS)
|
||||||
$(P) $(CXX) -o $(PROGRAM_PREFIX)yosys$(EXE) $(EXE_LINKFLAGS) $(LINKFLAGS) $(OBJS) $(LIBS) $(LIBS_VERIFIC)
|
$(P) $(CXX) -o $(PROGRAM_PREFIX)yosys$(EXE) $(EXE_LINKFLAGS) $(LINKFLAGS) $(OBJS) $(LIBS) $(LIBS_VERIFIC)
|
||||||
|
|
||||||
|
@ -975,7 +981,9 @@ clean:
|
||||||
rm -rf vloghtb/Makefile vloghtb/refdat vloghtb/rtl vloghtb/scripts vloghtb/spec vloghtb/check_yosys vloghtb/vloghammer_tb.tar.bz2 vloghtb/temp vloghtb/log_test_*
|
rm -rf vloghtb/Makefile vloghtb/refdat vloghtb/rtl vloghtb/scripts vloghtb/spec vloghtb/check_yosys vloghtb/vloghammer_tb.tar.bz2 vloghtb/temp vloghtb/log_test_*
|
||||||
rm -f tests/svinterfaces/*.log_stdout tests/svinterfaces/*.log_stderr tests/svinterfaces/dut_result.txt tests/svinterfaces/reference_result.txt tests/svinterfaces/a.out tests/svinterfaces/*_syn.v tests/svinterfaces/*.diff
|
rm -f tests/svinterfaces/*.log_stdout tests/svinterfaces/*.log_stderr tests/svinterfaces/dut_result.txt tests/svinterfaces/reference_result.txt tests/svinterfaces/a.out tests/svinterfaces/*_syn.v tests/svinterfaces/*.diff
|
||||||
rm -f tests/tools/cmp_tbdata
|
rm -f tests/tools/cmp_tbdata
|
||||||
$(MAKE) -C docs clean
|
-$(MAKE) -C docs clean
|
||||||
|
-$(MAKE) -C docs/images clean
|
||||||
|
rm -rf docs/source/cmd docs/util/__pycache__
|
||||||
|
|
||||||
clean-abc:
|
clean-abc:
|
||||||
$(MAKE) -C abc DEP= clean
|
$(MAKE) -C abc DEP= clean
|
||||||
|
|
|
@ -10,13 +10,14 @@ import sys
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
# expects __file__ = yosys/docs/tests/macro_commands.py
|
# expects __file__ = yosys/docs/tests/macro_commands.py
|
||||||
TESTS_DIR = Path(__file__).parent
|
TESTS_DIR = Path(__file__).parent.absolute()
|
||||||
ROOT_DIR = TESTS_DIR.parent.parent
|
ROOT_DIR = TESTS_DIR.parent.parent
|
||||||
|
logging.log(logging.INFO, f"Using {ROOT_DIR} as root directory")
|
||||||
THIS_FILE = (TESTS_DIR / "macro_commands.py").relative_to(ROOT_DIR)
|
THIS_FILE = (TESTS_DIR / "macro_commands.py").relative_to(ROOT_DIR)
|
||||||
MACRO_SOURCE = TESTS_DIR.parent / "source" / "code_examples" / "macro_commands"
|
MACRO_SOURCE = TESTS_DIR.parent / "source" / "code_examples" / "macro_commands"
|
||||||
assert MACRO_SOURCE.exists(), f"can't find macro_commands in {MACRO_SOURCE}"
|
assert MACRO_SOURCE.exists(), f"can't find macro_commands in {MACRO_SOURCE}"
|
||||||
|
|
||||||
YOSYS = TESTS_DIR.parent.parent / "yosys"
|
YOSYS = ROOT_DIR / "yosys"
|
||||||
assert YOSYS.exists(), f"can't find yosys executable in {YOSYS}"
|
assert YOSYS.exists(), f"can't find yosys executable in {YOSYS}"
|
||||||
|
|
||||||
raise_error = False
|
raise_error = False
|
||||||
|
|
Loading…
Reference in a new issue