diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml index 6e46e1dfb..24e7d84a5 100644 --- a/.github/actions/setup-build-env/action.yml +++ b/.github/actions/setup-build-env/action.yml @@ -5,6 +5,21 @@ inputs: runs-on: required: true type: string + get-build-deps: + description: 'Install Yosys build dependencies' + default: false + required: false + type: boolean + get-docs-deps: + description: 'Install Yosys docs dependencies' + default: false + required: false + type: boolean + get-test-deps: + description: 'Install Yosys test dependencies' + default: false + required: false + type: boolean get-iverilog: description: 'Install iverilog' default: false @@ -14,13 +29,34 @@ inputs: runs: using: composite steps: - - name: Install Linux Dependencies + - name: Linux common dependencies if: runner.os == 'Linux' uses: awalsh128/cache-apt-pkgs-action@v1.6.0 with: - packages: gperf build-essential bison flex libfl-dev libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python3 libboost-system-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev libbz2-dev libgtest-dev + packages: autoconf git make python3 + version: ${{ inputs.runs-on }}-commonys + + - name: Linux build dependencies + if: runner.os == 'Linux' && inputs.get-build-deps == 'true' + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 + with: + packages: bison clang flex libboost-filesystem-dev libboost-python-dev libboost-system-dev libbz2-dev libffi-dev libfl-dev libreadline-dev pkg-config tcl-dev zlib1g-dev version: ${{ inputs.runs-on }}-buildys + - name: Linux docs dependencies + if: runner.os == 'Linux' && inputs.get-docs-deps == 'true' + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 + with: + packages: graphviz xdot + version: ${{ inputs.runs-on }}-docsys + + - name: Linux test dependencies + if: runner.os == 'Linux' && inputs.get-test-deps == 'true' + uses: awalsh128/cache-apt-pkgs-action@v1.6.0 + with: + packages: gawk libgtest-dev + version: ${{ inputs.runs-on }}-testys + - name: Install macOS Dependencies if: runner.os == 'macOS' shell: bash diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 95595924a..da30e3da4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,8 +10,11 @@ jobs: name: Analyze runs-on: ubuntu-latest steps: - - name: Install deps - run: sudo apt-get install bison flex libfl-dev libreadline-dev tcl-dev libffi-dev + - name: Setup environment + uses: ./.github/actions/setup-build-env + with: + runs-on: ubuntu-latest + get-build-deps: true - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 6bd5495f0..8c1a3bbd2 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -62,6 +62,7 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} + get-build-deps: true - name: Build shell: bash @@ -109,7 +110,8 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} - setup-iverilog: true + get-test-deps: true + get-iverilog: true - name: Download build artifact uses: actions/download-artifact@v4 @@ -196,6 +198,8 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} + get-build-deps: true + get-docs-deps: true - name: Download build artifact uses: actions/download-artifact@v4 diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 5c5cdfd1d..6de52cf08 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -62,6 +62,7 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} + get-build-deps: true - name: Setup Cpp uses: aminya/setup-cpp@v1 diff --git a/.github/workflows/test-sanitizers.yml b/.github/workflows/test-sanitizers.yml index 6e3dfb2f2..4c8e3ec51 100644 --- a/.github/workflows/test-sanitizers.yml +++ b/.github/workflows/test-sanitizers.yml @@ -46,7 +46,9 @@ jobs: uses: ./.github/actions/setup-build-env with: runs-on: ${{ matrix.os }} - setup-iverilog: true + get-build-deps: true + get-test-deps: true + get-iverilog: true - name: Build shell: bash