2024-02-05 23:31:53 -06:00
|
|
|
name: Build and run tests
|
2021-10-27 18:18:16 -05:00
|
|
|
|
2024-04-25 01:37:44 -05:00
|
|
|
on: [push, pull_request]
|
2021-10-27 18:18:16 -05:00
|
|
|
|
|
|
|
jobs:
|
2024-05-08 16:26:18 -05:00
|
|
|
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'
|
2024-05-10 17:51:08 -05:00
|
|
|
pre_docs_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"]'
|
|
|
|
# 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'
|
2024-05-08 16:26:18 -05:00
|
|
|
|
2024-02-08 10:43:10 -06:00
|
|
|
build-yosys:
|
2024-02-09 17:34:07 -06:00
|
|
|
name: Reusable build
|
2024-02-08 10:43:10 -06:00
|
|
|
runs-on: ${{ matrix.os }}
|
2024-05-10 18:00:58 -05:00
|
|
|
needs: pre_docs_job
|
|
|
|
if: needs.pre_docs_job.outputs.should_skip != 'true'
|
2024-02-08 10:43:10 -06:00
|
|
|
env:
|
2024-02-09 17:34:07 -06:00
|
|
|
CC: clang
|
2024-02-08 10:43:10 -06:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-29 18:01:30 -05:00
|
|
|
os: [ubuntu-latest, macos-latest]
|
2024-02-08 10:43:10 -06:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
|
|
|
- name: Checkout Yosys
|
|
|
|
uses: actions/checkout@v4
|
2024-05-09 17:15:03 -05:00
|
|
|
with:
|
|
|
|
submodules: true
|
2024-02-08 10:43:10 -06:00
|
|
|
|
2024-03-03 18:12:45 -06:00
|
|
|
- name: Setup environment
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
|
2024-02-08 10:43:10 -06:00
|
|
|
- name: Build
|
2024-02-05 02:48:25 -06:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
2024-02-09 17:34:07 -06:00
|
|
|
make -f ../Makefile config-$CC
|
2024-08-05 12:28:09 -05:00
|
|
|
make -f ../Makefile -j$procs ENABLE_LTO=1
|
2024-02-09 17:34:07 -06:00
|
|
|
|
|
|
|
- name: Log yosys-config output
|
|
|
|
run: |
|
|
|
|
./yosys-config || true
|
2024-02-05 02:48:25 -06:00
|
|
|
|
|
|
|
- name: Compress build
|
2021-10-27 18:18:16 -05:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-02-05 02:48:25 -06:00
|
|
|
cd build
|
2024-02-05 16:48:38 -06:00
|
|
|
tar -cvf ../build.tar share/ yosys yosys-*
|
2021-10-27 18:18:16 -05:00
|
|
|
|
2024-01-24 15:15:43 -06:00
|
|
|
- name: Store build artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-02-05 23:31:53 -06:00
|
|
|
name: build-${{ matrix.os }}
|
2024-02-05 02:48:25 -06:00
|
|
|
path: build.tar
|
|
|
|
retention-days: 1
|
2024-01-24 15:15:43 -06:00
|
|
|
|
2024-02-05 23:31:53 -06:00
|
|
|
test-yosys:
|
2024-02-05 02:48:25 -06:00
|
|
|
name: Run tests
|
2024-02-05 16:48:38 -06:00
|
|
|
runs-on: ${{ matrix.os }}
|
2024-03-20 17:02:18 -05:00
|
|
|
needs: [build-yosys, pre_job]
|
|
|
|
if: needs.pre_job.outputs.should_skip != 'true'
|
2024-02-05 16:48:38 -06:00
|
|
|
env:
|
|
|
|
CC: clang
|
2024-02-05 15:56:20 -06:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-29 18:01:30 -05:00
|
|
|
os: [ubuntu-latest, macos-latest]
|
2024-03-21 16:06:30 -05:00
|
|
|
fail-fast: false
|
2024-02-05 02:48:25 -06:00
|
|
|
steps:
|
2024-02-05 15:30:37 -06:00
|
|
|
- name: Checkout Yosys
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-03-03 18:12:45 -06:00
|
|
|
- name: Setup environment
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
|
2024-02-05 15:56:20 -06:00
|
|
|
- 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
|
|
|
|
|
2024-09-30 09:25:22 -05:00
|
|
|
- name: Get vcd2fst
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/mmicko/libwave.git
|
|
|
|
mkdir -p ${{ github.workspace }}/.local/
|
|
|
|
cd libwave
|
|
|
|
cmake . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.local
|
|
|
|
make -j$procs
|
|
|
|
make install
|
|
|
|
|
2024-02-05 15:56:20 -06:00
|
|
|
- name: Cache iverilog
|
|
|
|
id: cache-iverilog
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: .local/
|
2024-02-05 16:48:38 -06:00
|
|
|
key: ${{ matrix.os }}-${{ env.IVERILOG_GIT }}
|
2024-02-05 15:56:20 -06:00
|
|
|
|
|
|
|
- name: Build iverilog
|
|
|
|
if: steps.cache-iverilog.outputs.cache-hit != 'true'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-02-05 17:18:52 -06:00
|
|
|
mkdir -p ${{ github.workspace }}/.local/
|
2024-02-05 15:56:20 -06:00
|
|
|
cd iverilog
|
|
|
|
autoconf
|
2024-02-05 17:18:52 -06:00
|
|
|
CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local
|
|
|
|
make -j$procs
|
2024-02-05 15:56:20 -06:00
|
|
|
make install
|
|
|
|
|
2024-02-05 02:48:25 -06:00
|
|
|
- name: Download build artifact
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
2024-02-05 23:31:53 -06:00
|
|
|
name: build-${{ matrix.os }}
|
2024-02-05 02:48:25 -06:00
|
|
|
|
|
|
|
- name: Uncompress build
|
|
|
|
shell: bash
|
|
|
|
run:
|
|
|
|
tar -xvf build.tar
|
|
|
|
|
2024-03-20 17:02:18 -05:00
|
|
|
- name: Log yosys-config output
|
|
|
|
run: |
|
|
|
|
./yosys-config || true
|
|
|
|
|
2024-02-05 02:48:25 -06:00
|
|
|
- name: Run tests
|
|
|
|
shell: bash
|
2024-02-04 16:29:46 -06:00
|
|
|
run: |
|
2024-02-05 16:48:38 -06:00
|
|
|
make -j$procs test TARGETS= EXTRA_TARGETS= CONFIG=$CC
|
2024-02-05 22:56:15 -06:00
|
|
|
|
|
|
|
- name: Report errors
|
|
|
|
if: ${{ failure() }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
find tests/**/*.err -print -exec cat {} \;
|
2024-03-20 17:02:18 -05:00
|
|
|
|
|
|
|
test-docs:
|
|
|
|
name: Run docs tests
|
|
|
|
runs-on: ${{ matrix.os }}
|
2024-05-10 17:51:08 -05:00
|
|
|
needs: [build-yosys, pre_docs_job]
|
|
|
|
if: needs.pre_docs_job.outputs.should_skip != 'true'
|
2024-03-20 17:02:18 -05:00
|
|
|
env:
|
|
|
|
CC: clang
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-25 01:37:44 -05:00
|
|
|
os: [ubuntu-latest]
|
2024-03-21 16:06:30 -05:00
|
|
|
fail-fast: false
|
2024-03-20 17:02:18 -05:00
|
|
|
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 }}
|
2024-07-18 21:23:31 -05:00
|
|
|
|
|
|
|
test-docs-build:
|
|
|
|
name: Try build docs
|
|
|
|
runs-on: [self-hosted, linux, x64]
|
|
|
|
needs: [pre_docs_job]
|
|
|
|
if: needs.pre_docs_job.outputs.should_skip != 'true'
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
docs-target: [html, latexpdf]
|
|
|
|
fail-fast: false
|
|
|
|
steps:
|
|
|
|
- name: Checkout Yosys
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
- name: Runtime environment
|
|
|
|
run: |
|
|
|
|
echo "procs=$(nproc)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Build Yosys
|
|
|
|
run: |
|
|
|
|
make config-clang
|
|
|
|
echo "ENABLE_CCACHE := 1" >> Makefile.conf
|
|
|
|
make -j${{ env.procs }}
|
|
|
|
|
|
|
|
- name: Build docs
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
make docs DOC_TARGET=${{ matrix.docs-target }} -j${{ env.procs }}
|
|
|
|
|
|
|
|
- name: Store docs build artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: docs-build-${{ matrix.docs-target }}
|
|
|
|
path: docs/build/
|
|
|
|
retention-days: 7
|