Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
# Copyright 2020 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# Run all lint checks
name: lint
on: [push, pull_request]
env:
VERIBLE_VERSION: 0.0-807-g10e7c71
jobs:
################
# Verible Lint #
################
verilog:
name: Verilog Sources
# This job runs on Linux (fixed ubuntu version)
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Install Verible
run: |
set -e
mkdir -p build/verible
cd build/verible
curl -Ls -o verible.tar.gz https://github.com/google/verible/releases/download/v$VERIBLE_VERSION/verible-v$VERIBLE_VERSION-Ubuntu-18.04-bionic-x86_64.tar.gz
sudo mkdir -p /tools/verible && sudo chmod 777 /tools/verible
tar -C /tools/verible -xf verible.tar.gz --strip-components=1
echo "PATH=$PATH:/tools/verible/bin" >> $GITHUB_ENV
# Run linter in hw/ip subdir
- name: Run Lint
run: |
echo "::add-matcher::.github/verible-lint-matcher.json"
util/verible-lint
echo "::remove-matcher owner=verible-lint-matcher::"
#####################
# Vendor Up-to-Date #
#####################
# Check that all vendored sources are up-to-date.
check-vendor:
name: Vendor Up-to-Date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install requirements
run: pip install -r python-requirements.txt
- name: Re-vendor and diff
run: |
find . \
-name '*.vendor.hjson' \
| xargs -n1 util/vendor.py --verbose \
&& util/git-diff.py --error-msg "::error ::Found differences, please re-vendor."
######################
# Opcodes Up-to-Date #
######################
check-opcodes:
name: Check Opcodes Up-to-Date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Install requirements
run: pip install -r python-requirements.txt
- name: Update opcodes and diff
run: |
./util/generate-opcodes.sh \
&& util/git-diff.py --error-msg "::error ::Found differences, please update all opcodes."
########################
# Check Doc up-to-date #
########################
check-doc:
name: Documentation Up-to-Date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12'
- run: npm install -g @adobe/jsonschema2md@v5.0.1
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: pip install -r python-requirements.txt
- name: Re-generate documentation and diff
run: |
cd docs/ && rm -r schema-doc && jsonschema2md -d schema/ --out schema-doc -x schema-doc -n
../util/git-diff.py --error-msg "::error ::Found stale documentation, please re-generate schema doc."
#################
# Check License #
#################
licence:
name: Check License
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install requirements
run: pip install -r python-requirements.txt
- name: Check license
run: |
echo "::add-matcher::.github/license-checker-matcher.json"
./util/check-license
echo "::remove-matcher owner=license-checker-matcher::"
####################
# Format YML Files #
####################
yamlfmt:
name: YAML Sources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install requirements
run: pip install -r python-requirements.txt
# Check the proper formatting of all Bender.yml
- name: Check YAML formatting
run: |
util/yml-format
util/git-diff.py --error-msg "::error ::Found differences, run util/yml-format before committing."
########################
# Check Python Sources #
########################
python:
name: Python Sources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install requirements
run: pip install flake8
# Check that all python sources conform to the `pep8` standard
- name: Check Python sources
run: |
echo "::add-matcher::.github/flake8-matcher.json"
flake8
echo "::remove-matcher owner=flake8-matcher::"
######################
# Clang-Format Check #
######################
# Check C/C++ files for correct formatting.
clangfmt:
name: C/C++ Sources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: DoozyX/clang-format-lint-action@v0.11
with:
clangFormatVersion: 10
######################
# Lint Editor Config #
######################
# Detect trailing whitespaces, missing new lines and wrong file encodings.
editorconfig:
name: Editorconfig
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install requirements
run: pip install -r python-requirements.txt
- name: Check files
run: |
echo "::add-matcher::.github/editorconfig-checker-matcher.json"
util/lint-editorconfig
echo "::remove-matcher owner=editorconfig-checker-matcher::"
###########
# Banshee #
###########
Banshee:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- working-directory: sw/banshee
run: cargo fmt --all -- --check
##########
# Occamy #
##########
# Re-generate all files and detect any changes on the generated files.
Occamy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install apt requirements
run: |
sudo apt update
sudo apt install device-tree-compiler clang-format-10
- name: Install Python requirements
run: pip install -r python-requirements.txt
- name: Install Verible
run: |
set -e
mkdir -p build/verible
cd build/verible
curl -Ls -o verible.tar.gz https://github.com/google/verible/releases/download/v$VERIBLE_VERSION/verible-v$VERIBLE_VERSION-Ubuntu-18.04-bionic-x86_64.tar.gz
sudo mkdir -p /tools/verible && sudo chmod 777 /tools/verible
tar -C /tools/verible -xf verible.tar.gz --strip-components=1
echo "PATH=$PATH:/tools/verible/bin" >> $GITHUB_ENV
- name: Generated Files Up-to-Date
env:
CLANG_FORMAT: clang-format-10
run: |
make -C hw/system/occamy all
util/git-diff.py --error-msg "::error ::Found differences, run \`make -C hw/system/occamy all\` before committing."
e1ffdbb97This file is pinned to the selected release. Download the original to open it in your design tool.