From 55a80ce2622fb89cecd061af8b7331eaaed05c6a Mon Sep 17 00:00:00 2001 From: Philipp van Kempen Date: Mon, 21 Mar 2022 11:06:55 +0100 Subject: [PATCH] [CI] Add licence header check --- .github/workflows/style.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 9b51ccdf6..eb0d5ba6b 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -34,3 +34,29 @@ jobs: black_args: "--line-length=120" flake8: true flake8_args: "--max-line-length=120" + + check-license: + name: Check for License headers + runs-on: ubuntu-latest + + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + + - name: Install Python dependencies + run: pip install licenseheaders + + - name: Download template file + run: wget https://raw.githubusercontent.com/johann-petrak/licenseheaders/master/templates/apache-2.tmpl + + - name: Run check + run: | + licenseheaders -t apache-2.tmpl -y $YEARS -o $OWNER -n MLonMCU -u $URL -d . -E $EXTENSIONS + test -z "$(git status --untracked-files=no --porcelain)" || (echo "Please check your license headers!" ; false) && echo "License check was successful." + env: + OWNER: "TUM Department of Electrical and Computer Engineering" + PROJECT: "MLonMCU" + YEARS: "2022" + URL: "https://github.com/tum-ei-eda/mlonmcu.git" + EXTENSIONS: "py c cpp" + EXCLUDE: ".venv models"