diff --git a/.checkpatch.conf b/.checkpatch.conf new file mode 100644 index 00000000..57de7eb4 --- /dev/null +++ b/.checkpatch.conf @@ -0,0 +1,8 @@ +# This isn't actually a Linux kernel tree +--no-tree + +--ignore FILE_PATH_CHANGES +--ignore COMPLEX_MACRO +--ignore NEW_TYPEDEFS +--ignore CONST_STRUCT +--ignore SPDX_LICENSE_TAG diff --git a/.github/license_config.yml b/.github/license_config.yml new file mode 100644 index 00000000..b5bd5842 --- /dev/null +++ b/.github/license_config.yml @@ -0,0 +1,16 @@ +license: + main: apache-2.0 + report_missing: true + category: Permissive +copyright: + check: true +exclude: + extensions: + - yml + - yaml + - html + - rst + - conf + - cfg + langs: + - HTML diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml new file mode 100644 index 00000000..f2a407a1 --- /dev/null +++ b/.github/workflows/checkpatch.yml @@ -0,0 +1,29 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + - name: checkpatch.pl PR review + uses: webispy/checkpatch-action@v8 + diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml new file mode 100644 index 00000000..bce1fb66 --- /dev/null +++ b/.github/workflows/license_check.yml @@ -0,0 +1,32 @@ +name: Scancode + +on: [pull_request] + +jobs: + scancode_job: + runs-on: ubuntu-20.04 + name: Scan code for licenses + steps: + - name: Checkout the code + uses: actions/checkout@v1 + - name: Scan the code + id: scancode + uses: zephyrproject-rtos/action_scancode@v4 + with: + directory-to-scan: 'scan/' + - name: Artifact Upload + uses: actions/upload-artifact@v1 + with: + name: scancode + path: ./artifacts + + - name: Verify + run: | + if [ -s ./artifacts/report.txt ]; then + report=$(cat ./artifacts/report.txt) + report="${report//'%'/'%25'}" + report="${report//$'\n'/'%0A'}" + report="${report//$'\r'/'%0D'}" + echo "::error file=./artifacts/report.txt::$report" + exit 1 + fi