Bump actions/download-artifact from 5 to 6 #48
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2025 RTLMeter contributors | |
| # | |
| # 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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.actor }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| name: "Check RTLMeter" | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-22.04 | |
| - ubuntu-24.04 | |
| runs-on: ${{ matrix.os }} | |
| outputs: | |
| cases: ${{ steps.gatherCases.outputs.cases }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup venv | |
| run: make venv | |
| - name: Format | |
| run: | | |
| make format && | |
| git config --global user.email "action@example.com" && | |
| git config --global user.name "github action" && | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git commit . -m "Apply 'make format'" && | |
| git push origin | |
| fi | |
| - name: Typecheck | |
| run: make typecheck | |
| - name: Lint | |
| run: make lint | |
| - name: Validate | |
| run: ./rtlmeter validate | |
| - name: Spellcheck | |
| run: make spellcheck | |
| - name: Gather cases for run | |
| id: gatherCases | |
| if: ${{ matrix.os == 'ubuntu-24.04' }} | |
| run: | | |
| # Gather all configurations into a JSON list | |
| echo "cases=[" >> cases.json | |
| ./rtlmeter show --cases | grep ":" | sed 's/:[^:]*$/",/' | sed 's/^/"/' | sort -u | sed "$ s/,//" >> cases.json | |
| echo "]" >> cases.json | |
| # Remove those that do not fit the runner memory | |
| sed -i "/OpenPiton:16x16/d" cases.json | |
| sed -i "/OpenPiton:32x32/d" cases.json | |
| # Set output variable | |
| cat cases.json | |
| tr "\n" " " < cases.json >> "$GITHUB_OUTPUT" | |
| build-verilator: | |
| name: "Build Verilator" | |
| needs: check # Not really a dependency, but don't bother if 'check' fails | |
| strategy: | |
| matrix: | |
| cxx: | |
| - g++ | |
| - clang++ | |
| os: | |
| - ubuntu-22.04 | |
| - ubuntu-24.04 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install ccache mold help2man libfl-dev libsystemc-dev | |
| # Some conflict of libunwind verison on 22.04, can live without it | |
| [[ "${{ matrix.os }}" == "ubuntu-22.04" ]] || sudo apt install libgoogle-perftools-dev | |
| - name: Checkout Verilator | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: "verilator/verilator" | |
| path: verilator | |
| - name: Configure | |
| working-directory: verilator | |
| run: | | |
| autoconf | |
| ./configure --prefix="$PWD/install" CXX=${{ matrix.cxx }} | |
| - name: Make | |
| working-directory: verilator | |
| run: make -j $(nproc) | |
| - name: Install | |
| working-directory: verilator | |
| run: make install | |
| - name: Tar up installation | |
| working-directory: verilator | |
| run: tar --posix -c -z -f verilator-${{ matrix.cxx }}-${{ matrix.os }}.tar.gz install | |
| - name: Upload Verilator installation archive | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: verilator/verilator-${{ matrix.cxx }}-${{ matrix.os }}.tar.gz | |
| name: verilator-${{ matrix.cxx }}-${{ matrix.os }} | |
| run-with-verilator: | |
| name: Run | |
| needs: | |
| - check | |
| - build-verilator | |
| strategy: | |
| max-parallel: 8 | |
| matrix: | |
| cxx: | |
| - g++ | |
| - clang++ | |
| os: | |
| - ubuntu-22.04 | |
| - ubuntu-24.04 | |
| case: ${{ fromJson(needs.check.outputs.cases) }} | |
| exclude: | |
| - { os: ubuntu-22.04, cxx: clang++ } # Seems to fill up disk space | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| path: rtlmeter | |
| - name: Setup venv | |
| working-directory: rtlmeter | |
| run: make venv | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install ccache mold | |
| - name: Download Verilator installation archive | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: verilator-${{ matrix.cxx }}-${{ matrix.os }} | |
| - name: Unpack Verilator installation archive | |
| run: | | |
| tar -x -z -f verilator-${{ matrix.cxx }}-${{ matrix.os }}.tar.gz | |
| ls -la | |
| - name: Run | |
| working-directory: rtlmeter | |
| run: | | |
| export PATH="$PWD/../install/bin:$PATH" | |
| ./rtlmeter run --cases="${{ matrix.case }}*" --compileArgs="$(jq -r '.["${{ matrix.case }}"] // empty' ci/compileArgs.json)" --verbose | |
| - name: Report | |
| working-directory: rtlmeter | |
| run: | | |
| ./rtlmeter report --steps "*" --metrics "*" |