Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: Initial metadata support #261

Merged
merged 56 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
af10c48
doc: initial draft version of metadata
trombik Nov 11, 2021
b0d4d67
doc: add `group` metadata object
trombik Nov 11, 2021
00eb8d4
meta: add groups.yml
trombik Nov 12, 2021
08128b6
meta: add metadata files to components starting from a to d
trombik Nov 12, 2021
289f1f1
meta: update metadata spec
trombik Nov 12, 2021
01caf7e
doc: mention SPDX ID in CONTRIBUTING
trombik Nov 12, 2021
2376363
ci: add metadata GitHub Workflows
trombik Nov 12, 2021
7a34e07
ci: create build_esp32_master job
trombik Nov 12, 2021
050868f
meta: typo fix, few more metadata files
UncleRus Nov 12, 2021
542fcb3
meta: fix group for ads111x
UncleRus Nov 12, 2021
023c548
meta: create classes for defined resorces
trombik Nov 12, 2021
f2dd904
meta: add group methods
trombik Nov 12, 2021
c305a09
meta: add tests for Component objects
trombik Nov 12, 2021
7a4f05f
meta: fix wrong regexp
trombik Nov 12, 2021
ab610d6
meta: update specs
trombik Nov 12, 2021
b8266da
ci: use documentation format in rspec output
trombik Nov 12, 2021
77c3320
meta: update classes, following changes in the spec
trombik Nov 12, 2021
a19bb36
meta: update spec file
trombik Nov 12, 2021
26fc4c6
meta: fix invalid metadata
trombik Nov 12, 2021
ea306c9
meta: document the test
trombik Nov 12, 2021
44dcc62
meta: fix Target resource in the class
trombik Nov 12, 2021
55efaeb
meta: lookup Person in persons.yml
trombik Nov 12, 2021
ace562b
meta: s/components/metadata_array/
trombik Nov 13, 2021
d1e9fb2
meta: return Person object in Copyright#name
trombik Nov 13, 2021
5e107eb
meta: make rubocop happy
trombik Nov 13, 2021
eac7fb3
meta: give a hint to users when metdata file cannot be opened
trombik Nov 13, 2021
c49f27f
meta: fix validate_keys
trombik Nov 13, 2021
ed6d992
meta: add a check for require keys, add helper methods
trombik Nov 13, 2021
df67fbe
meta: add validate_keys to Copyright
trombik Nov 13, 2021
8305d2f
meta: add `author` to `Copyright`
trombik Nov 13, 2021
5eeedc2
meta: add tests for groups.yml
trombik Nov 13, 2021
9388c37
meta: add tests for persons.yml
trombik Nov 13, 2021
cd8eb1a
meta: support shorthand for `name: foo`
trombik Nov 13, 2021
0e0a80b
meta: remove skip form tests to fix a bug
trombik Nov 13, 2021
9677a78
meta: document an issue in tests for `depends`
trombik Nov 13, 2021
790f64f
meta: support String shorthand for `Target`
trombik Nov 13, 2021
077da15
meta: always freeze constants
trombik Nov 13, 2021
8c4e353
meta: add tagets.yml and tests for it
trombik Nov 13, 2021
f7b2dc0
meta: document known issues
trombik Nov 13, 2021
0381022
meta: add .eil.yml starting from e to i
trombik Nov 13, 2021
7a7a091
meta: add .eil.yaml to components starting with l
trombik Nov 14, 2021
e326099
meta: add .eil.yml to components starting with m
trombik Nov 14, 2021
27032f2
meta: add .eil.yml to components starting with o
trombik Nov 14, 2021
9362933
meta: add .eil.yml to components starting with p
trombik Nov 14, 2021
b5adaac
meta: add .eil.yml to components starting with q
trombik Nov 14, 2021
e4afe76
meta: add .eil.yml to components starting with r
trombik Nov 14, 2021
8c36fe5
meta: add .eil.yml to components starting with s
trombik Nov 14, 2021
9d51807
meta: add .eil.yml to components starting with t
trombik Nov 14, 2021
b652bfd
meta: add .eil.yml to components starting with u
trombik Nov 14, 2021
a5257db
meta: add .eil.yml to components starting with w
trombik Nov 14, 2021
d1d14a1
meta: add .eil.yml to remaining components
trombik Nov 14, 2021
bdb501d
meta: remove DEVELOPER guard clause
trombik Nov 14, 2021
0d6f8b0
meta: test if a person is unique in persons.yml
trombik Nov 14, 2021
95624b6
meta: fix a typo
trombik Nov 14, 2021
735b466
meta: minor fixes in descriptions and groups
UncleRus Nov 16, 2021
99cc66c
meta: remove trash files
UncleRus Nov 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 134 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,138 @@ jobs:
# only sane way. as GitHub Actions does not support reusable steps, there
# are many duplications. but no need to modify the entire build process to
# adopt changes in master.
build_esp32_master:
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- esp32
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install python
uses: actions/setup-python@v2
with:

# XXX install python 3.8 because the official python package
# segfaults when installing modules in the runner.
#
# 2020-09-03T02:29:58.2517141Z Successfully installed cffi-1.14.2 cryptography-3.1 future-0.18.2 pycparser-2.20 pyparsing-2.3.1 pyserial-3.4 setuptools-50.1.0 six-1.15.0
# 2020-09-03T02:30:09.0409148Z /home/runner/work/_temp/66c91304-eef8-456d-84a1-7299428a62f7.sh: line 5: 4140 Segmentation fault (core dumped) python3 -m pip install --user -r ${IDF_PATH}/requirements.txt
# 2020-09-03T02:30:09.0414254Z ##[error]Process completed with exit code 139.
#
# possibly related issue:
# https://github.com/actions/virtual-environments/issues/159
python-version: 3.8

- name: Install dependencies
run: |
sudo apt-get install \
bison \
ccache \
flex \
gcc \
git \
gperf \
libffi-dev \
libncurses-dev \
libssl-dev \
make \
wget

- name: Set environment variables
id: set_env
run: |
SDK_NAME="esp-idf"
GCC_PREFIX="xtensa-${{ matrix.target }}-elf"
GCC_FILE="${GCC_PREFIX}-gcc"
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
TOOLCHAIN_VERSION="esp-2021r2-8.4.0"
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
DISTFILE_DIR="${HOME}/distfiles"
__PROJECT_PATH=`pwd`

# XXX actions/checkout does not allow to checkout a repository other
# than under __PROJECT_PATH
IDF_PATH="${__PROJECT_PATH}/idf"

echo "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
echo "IDF_TARGET=${{ matrix.target }}" >> ${GITHUB_ENV}

# cache-idf-tools needs __PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"

# XXX prefix all the environment variables with `__PROJECT_` to avoid pollution
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_FILE=${GCC_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_PREFIX=${GCC_PREFIX}" >> ${GITHUB_ENV}
echo "__PROJECT_SDK_NAME=${SDK_NAME}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_DIR=${TOOLCHAIN_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> ${GITHUB_ENV}
echo "__PROJECT_DISTFILE_DIR=${DISTFILE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_PATH=${__PROJECT_PATH}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND=${__PROJECT_BUILD_COMMAND}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND_ARG=${__PROJECT_BUILD_COMMAND_ARG}" >> ${GITHUB_ENV}

- name: Checkout the SDK
uses: actions/checkout@v2
with:
repository: espressif/esp-idf
path: idf
submodules: recursive
ref: master

- name: Fixup the SDK
run: |

# XXX workaround removed option, --no-site-packages, from virtualenv. should
# be removed when the following commit is merged
# https://github.com/espressif/esp-idf/commit/7a18f02acd7005f7c56e62175a8d1968a1a9019d
sed -i -e "s/'--no-site-packages',//" ${IDF_PATH}/tools/idf_tools.py

# XXX remove some modules
# gdbgui cannot be installed successfully with python 3.8
sed -i -e "s/^gdbgui.*//" -e "s/^pygdbmi.*//" ${IDF_PATH}/requirements.txt

- name: Run idf_tools.py install
run: |
${IDF_PATH}/tools/idf_tools.py install

- name: Run idf_tools.py install-python-env
run: |
${IDF_PATH}/tools/idf_tools.py install-python-env

- name: Build (idf.py)
run: |
IGNORE_FILE="ci-ignore"
. ${IDF_PATH}/export.sh

# XXX share cache between examples.
# see "Compiling In Different Directories" in ccache(1)
# | | 4.0.1 | master |
# |----------------------------------------|---------|---------|
# | without ccache | 33m 42s | 50m 27s |
# | CCACHE_BASEDIR and CCACHE_NOHASHDIR | 10m 41s | 16m 38s |
export CCACHE_BASEDIR="${__PROJECT_EXAMPLE_DIR}"
export CCACHE_NOHASHDIR=true

cd "${__PROJECT_EXAMPLE_DIR}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
# FIXME Remove this workaround when esp-idf issue #7621 will be fixed
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n" >> sdkconfig.defaults
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n" >> sdkconfig.defaults
echo "Building ${i}..."
idf.py --ccache build
fi
done

build_esp32_v4_x:
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
Expand All @@ -57,7 +189,6 @@ jobs:

# for supported versions by espressif, see:
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html
- master
- v4.0.4
- v4.1.2
- v4.2.2
Expand Down Expand Up @@ -118,9 +249,6 @@ jobs:
v4.3.*)
TOOLCHAIN_VERSION="esp-2021r1-8.4.0"
;;
master)
TOOLCHAIN_VERSION="esp-2021r2-8.4.0"
;;
*)
echo "Unknown matrix.branch: ${{ matrix.branch }}"
exit 1
Expand Down Expand Up @@ -181,13 +309,12 @@ jobs:
# moving target. do NOT cache tools if the branch is master.
uses: actions/cache@v2
id: cache-tools
if: ${{ matrix.branch != 'master' }}
with:
path: ${{ steps.set_env.outputs.PROJECT_TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ matrix.branch }}-${{ matrix.target }}-cache-tools

- name: Run idf_tools.py install
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' || matrix.branch == 'master' }}
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' }}
run: |
${IDF_PATH}/tools/idf_tools.py install

Expand Down Expand Up @@ -817,6 +944,7 @@ jobs:
name: All build
runs-on: ubuntu-latest
needs:
- build_esp32_master
- build_esp32_v4_x
- build_esp32_v3_x
- build_esp8266
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Metadata
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rake
134 changes: 134 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
# inherit_from: .rubocop_todo.yml

AllCops:
Exclude:
- "vendor/**/*"
# enable detailed explanations available in cops
# the default output is not enough to understand what is wrong
DisplayCopNames: true
ExtraDetails: true
DisplayStyleGuide: true

# the default CacheRootDirectory is no longer `/tmp`, but a directory under
# `$HOME` and some Unix platforms use symlink to that path
AllowSymlinksInCacheRootDirectory: true

Style/StringLiterals:
EnforcedStyle: double_quotes

Style/SymbolArray:
# perefer brackets for `grep-ability`
EnforcedStyle: brackets

Metrics/BlockLength:
Exclude:
- Guardfile
IgnoredMethods:
- describe
- context
- namespace

Layout/LineLength:
Exclude:
# Gemfile is not application code
- "Gemfile"
# ignore heredoc for readability
AllowHeredoc: true
# URLs are almost always long
AllowURI: true
URISchemes:
- http
- https
- git
- ftp
IgnoreCopDirectives: true

Gemspec/DateAssignment: # new in 1.10
Enabled: true
Layout/LineEndStringConcatenationIndentation: # new in 1.18
Enabled: true
Layout/SpaceBeforeBrackets: # new in 1.7
Enabled: true
Lint/AmbiguousAssignment: # new in 1.7
Enabled: true
Lint/AmbiguousOperatorPrecedence: # new in 1.21
Enabled: true
Lint/AmbiguousRange: # new in 1.19
Enabled: true
Lint/DeprecatedConstants: # new in 1.8
Enabled: true
Lint/DuplicateBranch: # new in 1.3
Enabled: true
Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
Enabled: true
Lint/EmptyBlock: # new in 1.1
Enabled: true
Lint/EmptyClass: # new in 1.3
Enabled: true
Lint/EmptyInPattern: # new in 1.16
Enabled: true
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
Enabled: true
Lint/LambdaWithoutLiteralBlock: # new in 1.8
Enabled: true
Lint/NoReturnInBeginEndBlocks: # new in 1.2
Enabled: true
Lint/NumberedParameterAssignment: # new in 1.9
Enabled: true
Lint/OrAssignmentToConstant: # new in 1.9
Enabled: true
Lint/RedundantDirGlobSort: # new in 1.8
Enabled: true
Lint/RequireRelativeSelfPath: # new in 1.22
Enabled: true
Lint/SymbolConversion: # new in 1.9
Enabled: true
Lint/ToEnumArguments: # new in 1.1
Enabled: true
Lint/TripleQuotes: # new in 1.9
Enabled: true
Lint/UnexpectedBlockArity: # new in 1.5
Enabled: true
Lint/UnmodifiedReduceAccumulator: # new in 1.1
Enabled: true
Security/IoMethods: # new in 1.22
Enabled: true
Style/ArgumentsForwarding: # new in 1.1
Enabled: true
Style/CollectionCompact: # new in 1.2
Enabled: true
Style/DocumentDynamicEvalDefinition: # new in 1.1
Enabled: true
Style/EndlessMethod: # new in 1.8
Enabled: true
Style/HashConversion: # new in 1.10
Enabled: true
Style/HashExcept: # new in 1.7
Enabled: true
Style/IfWithBooleanLiteralBranches: # new in 1.9
Enabled: true
Style/InPatternThen: # new in 1.16
Enabled: true
Style/MultilineInPatternThen: # new in 1.16
Enabled: true
Style/NegatedIfElseCondition: # new in 1.2
Enabled: true
Style/NilLambda: # new in 1.3
Enabled: true
Style/NumberedParameters: # new in 1.22
Enabled: true
Style/NumberedParametersLimit: # new in 1.22
Enabled: true
Style/QuotedSymbols: # new in 1.16
Enabled: true
Style/RedundantArgument: # new in 1.4
Enabled: true
Style/RedundantSelfAssignmentBranch: # new in 1.19
Enabled: true
Style/SelectByRegexp: # new in 1.22
Enabled: true
Style/StringChars: # new in 1.12
Enabled: true
Style/SwapValues: # new in 1.1
Enabled: true
17 changes: 14 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,12 @@ anyone and for any purpose.

We accept permissive licenses such as:

* ISC License
* MIT License
* BSD License
* [ISC](https://spdx.org/licenses/ISC.html) License
* [MIT](https://spdx.org/licenses/MIT.html) License
* [BSD-2-Clause](https://spdx.org/licenses/BSD-2-Clause.html) License

A list of licenses are available at
[SPDX License List](https://spdx.org/licenses/).

### Acceptable license for new code

Expand All @@ -434,6 +437,8 @@ The following is a preferred wording of the license.

```c
/*
* SPDX-License-Identifier: ISC
*
* Copyright (c) YYYY YOUR NAME HERE <user@your.dom.ain>
*
* Permission to use, copy, modify, and distribute this software for any
Expand All @@ -450,6 +455,12 @@ The following is a preferred wording of the license.
*/
```

Add `SPDX-License-Identifier: $YOUR_LICENSE` to your license header.
`$YOUR_LICENSE` is a SPDX License Identifier.

* [ISC](https://spdx.org/licenses/ISC.html)
* [BSD-2-Clause](https://spdx.org/licenses/BSD-2-Clause.html)

### Unacceptable licenses

We do NOT accept `copyleft` licenses such as:
Expand Down
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "irb"
gem "rake"
gem "rspec"
gem "rubocop"
Loading