forked from libre-chip/fayalite
		
	
		
			
				
	
	
		
			77 lines
		
	
	
	
		
			2.8 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			77 lines
		
	
	
	
		
			2.8 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
# SPDX-License-Identifier: LGPL-3.0-or-later
 | 
						|
# See Notices.txt for copyright information
 | 
						|
on:
 | 
						|
  workflow_call:
 | 
						|
    outputs:
 | 
						|
      cache-primary-key:
 | 
						|
        value: ${{ jobs.deps.outputs.cache-primary-key }}
 | 
						|
 | 
						|
jobs:
 | 
						|
  deps:
 | 
						|
    runs-on: debian-12
 | 
						|
    outputs:
 | 
						|
      cache-primary-key: ${{ steps.restore-deps.outputs.cache-primary-key }}
 | 
						|
    steps:
 | 
						|
      - uses: https://git.libre-chip.org/mirrors/checkout@v3
 | 
						|
        with:
 | 
						|
          fetch-depth: 0
 | 
						|
      - uses: https://git.libre-chip.org/mirrors/cache/restore@v3
 | 
						|
        id: restore-deps
 | 
						|
        with:
 | 
						|
          path: deps
 | 
						|
          key: ${{ github.repository }}-deps-${{ runner.os }}-${{ hashFiles('.forgejo/workflows/deps.yml') }}
 | 
						|
          lookup-only: true
 | 
						|
      - name: Install Apt packages
 | 
						|
        if: steps.restore-deps.outputs.cache-hit != 'true'
 | 
						|
        run: |
 | 
						|
          apt-get update -qq
 | 
						|
          apt-get install -qq \
 | 
						|
            bison \
 | 
						|
            build-essential \
 | 
						|
            ccache \
 | 
						|
            clang \
 | 
						|
            cvc5 \
 | 
						|
            flex \
 | 
						|
            gawk \
 | 
						|
            g++ \
 | 
						|
            git \
 | 
						|
            libboost-filesystem-dev \
 | 
						|
            libboost-python-dev \
 | 
						|
            libboost-system-dev \
 | 
						|
            libffi-dev \
 | 
						|
            libreadline-dev \
 | 
						|
            lld \
 | 
						|
            pkg-config \
 | 
						|
            python3 \
 | 
						|
            python3-click \
 | 
						|
            tcl-dev \
 | 
						|
            zlib1g-dev
 | 
						|
      - name: Install Firtool
 | 
						|
        if: steps.restore-deps.outputs.cache-hit != 'true'
 | 
						|
        run: |
 | 
						|
          mkdir -p deps
 | 
						|
          wget -O deps/firrtl.tar.gz https://github.com/llvm/circt/releases/download/firtool-1.86.0/firrtl-bin-linux-x64.tar.gz
 | 
						|
          sha256sum -c - <<<'bf6f4ab18ae76f135c944efbd81e25391c31c1bd0617c58ab0592640abefee14  deps/firrtl.tar.gz'
 | 
						|
          tar -C deps -xvaf deps/firrtl.tar.gz
 | 
						|
          rm -rf deps/firtool
 | 
						|
          mv deps/firtool-1.86.0 deps/firtool
 | 
						|
      - name: Get SymbiYosys
 | 
						|
        if: steps.restore-deps.outputs.cache-hit != 'true'
 | 
						|
        run: |
 | 
						|
          git clone --depth=1 --branch=yosys-0.45 https://git.libre-chip.org/mirrors/sby deps/sby
 | 
						|
      - name: Build Z3
 | 
						|
        if: steps.restore-deps.outputs.cache-hit != 'true'
 | 
						|
        run: |
 | 
						|
          git clone --depth=1 --recursive --branch=z3-4.13.3 https://git.libre-chip.org/mirrors/z3 deps/z3
 | 
						|
          (cd deps/z3; PYTHON=python3 ./configure --prefix=/usr/local)
 | 
						|
          make -C deps/z3/build -j"$(nproc)"
 | 
						|
      - name: Build Yosys
 | 
						|
        if: steps.restore-deps.outputs.cache-hit != 'true'
 | 
						|
        run: |
 | 
						|
          git clone --depth=1 --recursive --branch=0.45 https://git.libre-chip.org/mirrors/yosys deps/yosys
 | 
						|
          make -C deps/yosys -j"$(nproc)"
 | 
						|
      - uses: https://git.libre-chip.org/mirrors/cache/save@v3
 | 
						|
        if: steps.restore-deps.outputs.cache-hit != 'true'
 | 
						|
        with:
 | 
						|
          path: deps
 | 
						|
          key: ${{ steps.restore-deps.outputs.cache-primary-key }}
 |