[修改] 增加freeRTOS

1. 版本FreeRTOSv202212.01,命名为kernel;
This commit is contained in:
2023-05-06 16:43:01 +00:00
commit a345df017b
20944 changed files with 11094377 additions and 0 deletions

View File

@ -0,0 +1,40 @@
# Each line is a file pattern followed by one or more owners.
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @FreeRTOS/pr-bar-raiser
# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
# *.c FreeRTOS/pr-bar-raiser
# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
# *.go docs@example.com
# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
# /build/logs/ @doctocat
# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
# docs/* docs@example.com
# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
# apps/ @octocat
# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository and any of its
# subdirectories.
# /docs/ @doctocat

View File

@ -0,0 +1,59 @@
#!/bin/bash -
PROJECT=$1
echo "Verifying url links of: ${PROJECT}"
if [ ! -d "$PROJECT" ]
then
echo "Directory passed does not exist"
exit 2
fi
SCRIPT_RET=0
set -o nounset # Treat unset variables as an error
declare -A dict
function test {
while IFS= read -r LINE; do
FILE=$(echo $LINE | cut -f 1 -d ':')
URL=$(echo $LINE | grep -IoE '\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]')
# remove trailing / if it exists curl diferenciate between links with
# and without / at the end
# URL=`echo "$URL" | sed 's,/$,,'`
dict+=(["$URL"]="$FILE ")
done < <(grep -e 'https\?://' ${PROJECT} -RIa --exclude='*.exe' --exclude-dir=.git | tr '*' ' ')
for UNIQ_URL in ${!dict[@]} # loop urls
do
CURL_RES=$(curl -I ${UNIQ_URL} 2>/dev/null| head -n 1 | cut -f 2 -d ' ')
RES=$?
if [ "${CURL_RES}" == '' -o "${CURL_RES}" != '200' ]
then
echo "URL is: ${UNIQ_URL}"
echo "File names: ${dict[$UNIQ_URL]}"
if [ "${CURL_RES}" == '' ] # curl returned an error
then
CURL_RES=$RES
SCRIPT_RET=1
elif [ "${CURL_RES}" == '403' ]
then
SCRIPT_RET=1
fi
echo Result is: "${CURL_RES}"
echo "================================="
fi
done
if [ "${SCRIPT_RET}" -eq 0 ]
then
exit 0
else
exit 1
fi
}
test

View File

@ -0,0 +1,15 @@
{
"lib_name": "corePKCS11",
"src": [
"source/core_pkcs11.c",
"source/core_pki_utils.c",
"source/portable/mbedtls/core_pkcs11_mbedtls.c"
],
"include": [
"source/include",
"source/dependency/3rdparty/pkcs11",
"build/_deps/mbedtls_2-src/include",
"source/dependency/3rdparty/mbedtls_utils",
"test/include"
]
}

View File

@ -0,0 +1,193 @@
name: CI Checks
on:
push:
branches: ["**"]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
system-tests:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
- name: Build
run: |
CFLAGS="-Wall -Wextra -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG"
CFLAGS+=" -fsanitize=address,undefined"
cmake -S test -B build/ \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DSYSTEM_TESTS=1 \
-DUNIT_TESTS=0 \
-DCMAKE_C_FLAGS="${CFLAGS}"
make -C build/ all
- name: Integration Tests
run: |
cd build/
ctest --output-on-failure
unit-tests-with-sanitizer:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
- name: Build
run: |
CFLAGS="-Wall -Wextra -DNDEBUG"
CFLAGS+=" -fsanitize=address,undefined"
cmake -S test -B build/ \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DUNIT_TESTS=1 \
-DSYSTEM_TESTS=0 \
-DCMAKE_C_FLAGS="${CFLAGS}"
make -C build/ all
- name: Unit Tests
run: |
cd build/
ctest --output-on-failure
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
- name: Build
run: |
sudo apt-get install -y lcov
CFLAGS="--coverage -Wall -Wextra -DNDEBUG"
cmake -S test -B build/ \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DUNIT_TESTS=1 \
-DSYSTEM_TESTS=0 \
-DCMAKE_C_FLAGS="${CFLAGS}"
make -C build/ all
- name: Unit Tests
run: |
cd build/
ctest --output-on-failure
cd ..
- name: Coverage
run: |
make -C build/ coverage
lcov --rc lcov_branch_coverage=1 --remove build/coverage.info '*test*' --output-file build/coverage.info
lcov --rc lcov_branch_coverage=1 --remove build/coverage.info '*CMakeCCompilerId*' --output-file build/coverage.info
lcov --rc lcov_branch_coverage=1 --remove build/coverage.info '*mocks*' --output-file build/coverage.info
lcov --list build/coverage.info
- name: Check Coverage
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
with:
path: ./build/coverage.info
line-coverage-min: 99
branch-coverage-min: 90
complexity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup
run: sudo apt-get install complexity
- name: Complexity
run: |
find source/ -iname '*.c' -not -path 'source/portable/windows/*' -not -path 'source/dependency*' |\
xargs complexity --scores --threshold=0 --horrid-threshold=8
doxygen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check doxygen build
uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main
with:
path: ./
spell-check:
runs-on: ubuntu-latest
steps:
- name: Checkout Parent Repo
uses: actions/checkout@v2
with:
ref: main
repository: aws/aws-iot-device-sdk-embedded-C
- run: rm -r libraries/standard/corePKCS11
- name: Clone This Repo
uses: actions/checkout@v2
with:
path: libraries/standard/corePKCS11
- name: Install spell
run: |
sudo apt-get install spell
sudo apt-get install util-linux
- name: Check spelling
run: |
PATH=$PATH:$PWD/tools/spell
# Modifies `find` command used in spell checker to ignore the test and dependency directory
# The command looks like this `extract-comments `find $DIRNAME -name \*.[ch]` should the line change and the sed command will
# append "-not path {val added below}" for each of the directories mentioned.
# https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/ad28ed355df4f82b77f48028e24bd6fc9e63bc54/tools/spell/find-unknown-comment-words#L86
sed -i 's/find $DIRNAME/find $DIRNAME -not -path '*test*' -not -path '*dependency*'/g' tools/spell/find-unknown-comment-words
find-unknown-comment-words --directory libraries/standard/corePKCS11
if [ "$?" = "0" ]; then
exit 0
else
exit 1
fi
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check formatting
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
with:
path: ./
exclude-dirs: .git
link-verifier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python for link verifier action
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Check Links
uses: FreeRTOS/CI-CD-GitHub-Actions/link-verifier@main
with:
path: ./
exclude-dirs: cbmc
include-file-types: .c,.h,.dox
git-secrets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout awslabs/git-secrets
uses: actions/checkout@v2
with:
repository: awslabs/git-secrets
ref: master
path: git-secrets
- name: Install git-secrets
run: cd git-secrets && sudo make install && cd ..
- name: Run git-secrets
run: |
git-secrets --register-aws
git-secrets --scan
memory_statistics:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git submodule update --init --recursive --checkout
- name: Fetch dependencies (mbedtls)
run: |
cmake -S test -B build/ \
-G "Unix Makefiles" \
-DUNIT_TESTS=0 \
-DSYSTEM_TESTS=0 \
-DCMAKE_C_FLAGS="${CFLAGS}"
- name: Install Python3
uses: actions/setup-python@v2
with:
python-version: '3.7.10'
- name: Measure sizes
uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
with:
config: .github/memory_statistics_config.json
check_against: docs/doxygen/include/size_table.md

View File

@ -0,0 +1,11 @@
name: Doxygen Generation
on:
push:
branches: [main]
workflow_dispatch:
jobs:
doxygen-generation:
runs-on: ubuntu-latest
steps:
- name: Doxygen generation
uses: FreeRTOS/CI-CD-Github-Actions/doxygen-generation@main

View File

@ -0,0 +1,139 @@
name: Release automation
on:
workflow_dispatch:
inputs:
commit_id:
description: 'Commit ID to tag and create a release for'
required: true
version_number:
description: 'Release Version Number (Eg, v1.0.0)'
required: true
jobs:
tag-commit:
name: Tag commit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.commit_id }}
- name: Configure git identity
run: |
git config --global user.name ${{ github.actor }}
git config --global user.email ${{ github.actor }}@users.noreply.github.com
- name: create a new branch that references commit id
run: git checkout -b ${{ github.event.inputs.version_number }} ${{ github.event.inputs.commit_id }}
- name: Generate SBOM
uses: FreeRTOS/CI-CD-Github-Actions/sbom-generator@main
with:
repo_path: ./
source_path: ./source
- name: commit SBOM file
run: |
git add .
git commit -m 'Update SBOM'
git push -u origin ${{ github.event.inputs.version_number }}
- name: Tag Commit and Push to remote
run: |
git tag ${{ github.event.inputs.version_number }} -a -m "corePKCS11 Library ${{ github.event.inputs.version_number }}"
git push origin --tags
- name: Verify tag on remote
run: |
git tag -d ${{ github.event.inputs.version_number }}
git remote update
git checkout tags/${{ github.event.inputs.version_number }}
git diff ${{ github.event.inputs.commit_id }} tags/${{ github.event.inputs.version_number }}
create-zip:
needs: tag-commit
name: Create ZIP and verify package for release asset.
runs-on: ubuntu-latest
steps:
- name: Install ZIP tools
run: sudo apt-get install zip unzip
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.commit_id }}
path: corePKCS11
submodules: recursive
- name: Checkout disabled submodules
run: |
cd corePKCS11
git submodule update --init --checkout --recursive
- name: Create ZIP
run: |
zip -r corePKCS11-${{ github.event.inputs.version_number }}.zip corePKCS11 -x "*.git*"
ls ./
- name: Validate created ZIP
run: |
mkdir zip-check
mv corePKCS11-${{ github.event.inputs.version_number }}.zip zip-check
cd zip-check
unzip corePKCS11-${{ github.event.inputs.version_number }}.zip -d corePKCS11-${{ github.event.inputs.version_number }}
ls corePKCS11-${{ github.event.inputs.version_number }}
diff -r -x "*.git*" corePKCS11-${{ github.event.inputs.version_number }}/corePKCS11/ ../corePKCS11/
cd ../
- name: Build
run: |
cd zip-check/corePKCS11-${{ github.event.inputs.version_number }}/corePKCS11
sudo apt-get install -y lcov
cmake -S test -B build/ \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_CLONE_SUBMODULES=ON \
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG'
make -C build/ all
- name: Test
run: |
cd zip-check/corePKCS11-${{ github.event.inputs.version_number }}/corePKCS11/build/
ctest -E system --output-on-failure
cd ..
- name: Create artifact of ZIP
uses: actions/upload-artifact@v2
with:
name: corePKCS11-${{ github.event.inputs.version_number }}.zip
path: zip-check/corePKCS11-${{ github.event.inputs.version_number }}.zip
deploy-doxygen:
needs: tag-commit
name: Deploy doxygen documentation
runs-on: ubuntu-latest
steps:
- name: Doxygen generation
uses: FreeRTOS/CI-CD-Github-Actions/doxygen-generation@main
with:
ref: ${{ github.event.inputs.version_number }}
add_release: "true"
create-release:
needs:
- create-zip
- deploy-doxygen
name: Create Release and Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version_number }}
release_name: ${{ github.event.inputs.version_number }}
body: Release ${{ github.event.inputs.version_number }} of the corePKCS11 Library.
draft: false
prerelease: false
- name: Download ZIP artifact
uses: actions/download-artifact@v2
with:
name: corePKCS11-${{ github.event.inputs.version_number }}.zip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./corePKCS11-${{ github.event.inputs.version_number }}.zip
asset_name: corePKCS11-${{ github.event.inputs.version_number }}.zip
asset_content_type: application/zip