From af7e2282103c3cbe0b40db2f50500ff9fe6a171b Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Tue, 31 Oct 2023 14:31:18 +0100 Subject: [PATCH] Add samples and CI test Signed-off-by: Neil Armstrong --- .github/workflows/yaml.yml | 43 +++++++++++++++++++++++ .yamllint | 39 +++++++++++++++++++++ config-samples/sample1.yaml | 13 +++++++ config-samples/sample10.yaml | 65 ++++++++++++++++++++++++++++++++++ config-samples/sample2.yaml | 12 +++++++ config-samples/sample3.yaml | 12 +++++++ config-samples/sample4.yaml | 13 +++++++ config-samples/sample5.yaml | 12 +++++++ config-samples/sample6.yaml | 12 +++++++ config-samples/sample7.yaml | 16 +++++++++ config-samples/sample8.yaml | 68 ++++++++++++++++++++++++++++++++++++ config-samples/sample9.yaml | 26 ++++++++++++++ 12 files changed, 331 insertions(+) create mode 100644 .github/workflows/yaml.yml create mode 100644 .yamllint create mode 100644 config-samples/sample1.yaml create mode 100644 config-samples/sample10.yaml create mode 100644 config-samples/sample2.yaml create mode 100644 config-samples/sample3.yaml create mode 100644 config-samples/sample4.yaml create mode 100644 config-samples/sample5.yaml create mode 100644 config-samples/sample6.yaml create mode 100644 config-samples/sample7.yaml create mode 100644 config-samples/sample8.yaml create mode 100644 config-samples/sample9.yaml diff --git a/.github/workflows/yaml.yml b/.github/workflows/yaml.yml new file mode 100644 index 0000000..541a67f --- /dev/null +++ b/.github/workflows/yaml.yml @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (c) 2021 Canonical Ltd. +# Copyright (c) 2023 Linaro Ltd +# Author: Krzysztof Kozlowski +# +# +# Loosely based on: https://github.com/linux-test-project/ltp +# https://github.com/linux-nfc/neard +# +name: "Yaml" +on: + pull_request: + push: + workflow_dispatch: + +jobs: + job: + name: Yaml + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + + container: + image: ubuntu:jammy + + steps: + - name: Git checkout + uses: actions/checkout@v3 + + - name: Install additional packages + run: | + export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true + apt update + apt install -y --no-install-recommends python3-setuptools python3-pip + pip3 install yamllint jsonschema ruamel.yaml + + - name: Lint samples + run: for file in config-samples/*; do yamllint $file; done + + - name: Check samples + run: for file in config-samples/*; do python3 ./validate.py -s schema.yaml $file; done diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..4abe9f0 --- /dev/null +++ b/.yamllint @@ -0,0 +1,39 @@ +extends: relaxed + +rules: + line-length: + # 80 chars should be enough, but don't fail if a line is longer + max: 110 + allow-non-breakable-words: true + level: warning + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + colons: {max-spaces-before: 0, max-spaces-after: 1} + commas: {min-spaces-after: 1, max-spaces-after: 1} + comments: + require-starting-space: true + min-spaces-from-content: 1 + comments-indentation: disable + document-start: + present: true + empty-lines: + max: 3 + max-end: 1 + empty-values: + forbid-in-block-mappings: true + forbid-in-flow-mappings: true + hyphens: + max-spaces-after: 1 + indentation: + spaces: 2 + indent-sequences: true + check-multi-line-strings: false + trailing-spaces: false diff --git a/config-samples/sample1.yaml b/config-samples/sample1.yaml new file mode 100644 index 0000000..c7151b4 --- /dev/null +++ b/config-samples/sample1.yaml @@ -0,0 +1,13 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + fastboot_set_active: a + fastboot_key_timeout: 2 + usb_always_on: false + cdba: /dev/serial/by-id/usb-CDBA-if00 + voltage: 1800 diff --git a/config-samples/sample10.yaml b/config-samples/sample10.yaml new file mode 100644 index 0000000..23cd168 --- /dev/null +++ b/config-samples/sample10.yaml @@ -0,0 +1,65 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER_KEY,3,ACTIVE_HIGH;USB_DISCONNECT,7,ACTIVE_LOW" + - board: myboard-2 + name: "My Board 2" + description: | + My Awesome board Number 2 + console: /dev/ttyABC1 + fastboot: cacafada + ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D;POWER_KEY,3,ACTIVE_HIGH;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH" + - board: myboard-3 + name: "My Board 2" + description: | + My Awesome board Number 3 + console: /dev/ttyABC2 + fastboot: cacafada + ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER,1,ACTIVE_LOW" + - board: myboard-4 + name: "My Board 2" + description: | + My Awesome board Number 4 + console: /dev/ttyABC3 + fastboot: cacafada + ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D;POWER,1,ACTIVE_LOW" + - board: myboard-5 + name: "My Board 2" + description: | + My Awesome board Number 5 + console: /dev/ttyABC4 + fastboot: cacafada + ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8;D" + - board: myboard-6 + name: "My Board 2" + description: | + My Awesome board Number 6 + console: /dev/ttyABC5 + fastboot: cacafada + ftdi_gpio: "s:0x0403:0x6011:FT7YWRL8" + - board: myboard-7 + name: "My Board 2" + description: | + My Awesome board Number 7 + console: /dev/ttyABC6 + fastboot: cacafada + ftdi_gpio: "i:0x0403:0x6011;D;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER_KEY,3,ACTIVE_HIGH;USB_DISCONNECT,7,ACTIVE_LOW" + - board: myboard-8 + name: "My Board 2" + description: | + My Awesome board Number 7 + console: /dev/ttyABC6 + fastboot: cacafada + ftdi_gpio: "i:0x0403:0x6011:0;D;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER_KEY,3,ACTIVE_HIGH;USB_DISCONNECT,7,ACTIVE_LOW" + - board: myboard-9 + name: "My Board 2" + description: | + My Awesome board Number 7 + console: /dev/ttyABC6 + fastboot: cacafada + ftdi_gpio: "d:/dev/bus/usb/006/001;D;POWER,1,ACTIVE_LOW;FASTBOOT_KEY,0,ACTIVE_HIGH;POWER_KEY,3,ACTIVE_HIGH;USB_DISCONNECT,7,ACTIVE_LOW" diff --git a/config-samples/sample2.yaml b/config-samples/sample2.yaml new file mode 100644 index 0000000..f2a5114 --- /dev/null +++ b/config-samples/sample2.yaml @@ -0,0 +1,12 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + fastboot_set_active: b + fastboot_key_timeout: 2 + usb_always_on: false + conmux: /dev/serial/by-id/usb-CDBA-if00 diff --git a/config-samples/sample3.yaml b/config-samples/sample3.yaml new file mode 100644 index 0000000..50921e1 --- /dev/null +++ b/config-samples/sample3.yaml @@ -0,0 +1,12 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + fastboot_set_active: true + fastboot_key_timeout: 2 + usb_always_on: false + external: /path/to/my/awesome/script.sh diff --git a/config-samples/sample4.yaml b/config-samples/sample4.yaml new file mode 100644 index 0000000..9e67b51 --- /dev/null +++ b/config-samples/sample4.yaml @@ -0,0 +1,13 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + fastboot_set_active: true + fastboot_key_timeout: 2 + usb_always_on: false + ppps_path: 2-2:1.0/2-2-port2 + ppps3_path: 2-2:2.0/2-2-port2 diff --git a/config-samples/sample5.yaml b/config-samples/sample5.yaml new file mode 100644 index 0000000..e4c0771 --- /dev/null +++ b/config-samples/sample5.yaml @@ -0,0 +1,12 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + fastboot_set_active: true + fastboot_key_timeout: 2 + usb_always_on: false + qcomlt_debug_board: /dev/serial/by-id/usb-DebugBoard-if00 diff --git a/config-samples/sample6.yaml b/config-samples/sample6.yaml new file mode 100644 index 0000000..f544d1b --- /dev/null +++ b/config-samples/sample6.yaml @@ -0,0 +1,12 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + fastboot_set_active: true + fastboot_key_timeout: 2 + usb_always_on: false + alpaca: /dev/serial/by-id/usb-ALPACA-if00 diff --git a/config-samples/sample7.yaml b/config-samples/sample7.yaml new file mode 100644 index 0000000..7fc3ee0 --- /dev/null +++ b/config-samples/sample7.yaml @@ -0,0 +1,16 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + fastboot_set_active: true + fastboot_key_timeout: 2 + usb_always_on: false + cdba: /dev/serial/by-id/usb-CDBA-if00 + voltage: 1800 + users: + - toto + - tata diff --git a/config-samples/sample8.yaml b/config-samples/sample8.yaml new file mode 100644 index 0000000..49dbdf1 --- /dev/null +++ b/config-samples/sample8.yaml @@ -0,0 +1,68 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + ftdi_gpio: + description: "s:0x0403:0x6011:FT7YWRL8" + interface: A + gpios: + - power_key: + line: 2 + - fastboot_key: + line: 0 + active_low: true + - power: + line: 1 + active_low: true + - board: myboard-2 + name: "My Board 2" + description: | + My Awesome board Number 2 + console: /dev/ttyABC1 + fastboot: cacafada + ftdi_gpio: + description: "s:0x0403:0x6011:FT456RL8" + interface: B + gpios: + - power: + line: 1 + active_low: true + - fastboot_key: + line: 0 + active_low: true + - power_key: + line: 2 + - usb_disconnect: + line: 7 + active_low: true + - board: myboard-3 + name: "My Board 3" + description: | + My Awesome board Number 3 + console: /dev/ttyABC1 + fastboot: cacafada + ftdi_gpio: + description: "i:0x0403:0x6011" + interface: C + gpios: + - power_key: + line: 2 + - power: + line: 1 + active_low: true + - board: myboard-4 + name: "My Board 4" + description: | + My Awesome board Number 4 + console: /dev/ttyABC1 + fastboot: cacafada + ftdi_gpio: + description: "d:/dev/bus/usb/006/001" + interface: D + gpios: + - power: + line: 6 diff --git a/config-samples/sample9.yaml b/config-samples/sample9.yaml new file mode 100644 index 0000000..665e72f --- /dev/null +++ b/config-samples/sample9.yaml @@ -0,0 +1,26 @@ +--- +devices: + - board: myboard + name: "My Board" + description: | + My Awesome board + console: /dev/ttyABC0 + fastboot: cacafada + fastboot_set_active: true + fastboot_key_timeout: 2 + local_gpio: + - power: + chip: gpiochip0 + line: 7 + active_low: true + - fastboot_key: + chip: gpiochip0 + line: 8 + active_low: true + - power_key: + chip: gpiochip0 + line: 14 + active_low: true + - usb_disconnect: + chip: gpiochip0 + line: 4