LLC Partitioning Function #42
This file contains 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 2022 ETH Zurich and University of Bologna. | |
# Solderpad Hardware License, Version 0.51, see LICENSE for details. | |
# SPDX-License-Identifier: SHL-0.51 | |
# Author: Michael Rogenmoser <michaero@iis.ee.ethz.ch> | |
name: ci | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
env: | |
BENDER: ./bender | |
MORTY: ./morty | |
jobs: | |
check-clean: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: Setup Graphviz | |
uses: ts-graphviz/setup-graphviz@v1 | |
- name: Install Bender | |
run: make bender | |
- name: Install Morty | |
run: make morty | |
- name: Python Requirements | |
run: pip install -r requirements.txt | |
- name: Check clean make targets | |
run: | | |
make -B pickle doc graph regs | |
make clean | |
git status && test -z "$(git status --porcelain)" | |
check-stale: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: Setup Graphviz | |
uses: ts-graphviz/setup-graphviz@v1 | |
- name: Install Bender | |
run: make bender | |
- name: Install Morty | |
run: make morty | |
- name: Python Requirements | |
run: pip install -r requirements.txt | |
- name: Check clean makefile | |
run: | | |
make -B pickle doc graph regs | |
git status && test -z "$(git status --porcelain)" | |
lint: | |
runs-on: ubuntu-latest | |
needs: [check-clean, check-stale] | |
strategy: | |
fail-fast: false | |
matrix: | |
lint_check: [license, python] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: Python Requirements | |
run: python3 -m pip install -r requirements.txt | |
- name: Install Bender | |
run: make bender | |
- name: Lint license | |
if: ${{ matrix.lint_check == 'license' }} | |
run: scripts/check-license | |
- name: Lint python | |
if: ${{ matrix.lint_check == 'python' }} | |
run: scripts/python-lint | |
lint-commit: | |
runs-on: ubuntu-latest | |
needs: [check-clean, check-stale] | |
steps: | |
- uses: actions/checkout@v3 | |
if: ${{ github.event_name == 'push' }} | |
- uses: actions/checkout@v3 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: Python Requirements | |
run: python3 -m pip install -r requirements.txt | |
- name: Lint commits | |
run: python3 util/lint-commits.py HEAD | |
# lint-verilog: | |
# runs-on: ubuntu-latest | |
# needs: [check-clean, check-stale] | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: chipsalliance/verible-linter-action@main | |
# with: | |
# paths: | | |
# ./src | |
# exclude_paths: | | |
# ./test | |
# extra_args: "--rules=-interface-name-style --lint_fatal --parse_fatal --waiver_files util/waiver.verible" | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# reviewdog_reporter: github-check | |
analyze-contributors: | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- uses: actions/checkout@v3 | |
- name: List contributors | |
run: scripts/list-contributors | tee contributions.txt | |
- name: Upload contributions.txt | |
uses: actions/upload-artifact@v2 | |
with: | |
name: contributions | |
path: contributions.txt | |
retention-days: 7 | |
analyze-todos: | |
runs-on: ubuntu-latest | |
needs: lint | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v3 | |
- name: List todos | |
run: scripts/list-todos | tee open_todos.txt | |
- name: Upload todos.txt | |
uses: actions/upload-artifact@v2 | |
with: | |
name: open_todos | |
path: open_todos.txt | |
retention-days: 7 | |
docs: | |
runs-on: ubuntu-22.04 | |
needs: [lint] # , lint-verilog | |
env: | |
MORTY: ./morty | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Bender | |
run: make bender | |
- name: Setup Graphviz | |
uses: ts-graphviz/setup-graphviz@v1 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: Python Requirements | |
run: python3 -m pip install -r requirements.txt | |
- name: Install Morty | |
run: make morty | |
- name: Build Doc | |
run: make doc | |
- name: Pickle | |
run: make -B pickle | |
- name: Graph | |
run: make graph | |
- name: Upload doc | |
uses: actions/upload-artifact@v2 | |
with: | |
name: doc | |
path: doc/morty | |
retention-days: 7 | |
- name: Upload graph | |
uses: actions/upload-artifact@v2 | |
with: | |
name: graph | |
path: doc/morty-graph | |
retention-days: 7 | |
- name: Upload pickle | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pickle | |
path: pickle | |
retention-days: 7 | |
- name: Create publish docs | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/upload-pages-artifact@main | |
with: | |
path: doc/morty | |
deploy-pages: | |
needs: docs | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.output.page_url }} | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- name: Deploy to Github Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |