summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authortswan22 <[email protected]>2025-11-01 12:51:40 -0400
committertswan22 <[email protected]>2025-11-01 12:51:40 -0400
commitca44c772f7ad87a8d12de0b3a57ad8816f2edc10 (patch)
tree2ac98dc0c073ca161741751504fdbeb0b710dd11 /.github
parent9d46cca57637cfd086499970a8f5d5669ba9bfa0 (diff)
parenta6c16d147593732028ed89292805e0e6a972e4b5 (diff)
Merge branch 'master' of https://github.com/hathach/tinyusb
Diffstat (limited to '.github')
-rw-r--r--.github/actions/get_deps/action.yml4
-rw-r--r--.github/actions/setup_toolchain/action.yml10
-rw-r--r--.github/actions/setup_toolchain/download/action.yml31
-rw-r--r--.github/actions/setup_toolchain/espressif/action.yml14
-rw-r--r--.github/workflows/static_analysis.yml66
5 files changed, 72 insertions, 53 deletions
diff --git a/.github/actions/get_deps/action.yml b/.github/actions/get_deps/action.yml
index b0d6d1066..a84db893b 100644
--- a/.github/actions/get_deps/action.yml
+++ b/.github/actions/get_deps/action.yml
@@ -26,7 +26,9 @@ runs:
shell: bash
- name: Get Dependencies
+ env:
+ ARG: ${{ inputs.arg }}
run: |
- python3 tools/get_deps.py ${{ inputs.arg }}
+ python3 tools/get_deps.py ${ARG}
echo "PICO_SDK_PATH=${{ github.workspace }}/pico-sdk" >> $GITHUB_ENV
shell: bash
diff --git a/.github/actions/setup_toolchain/action.yml b/.github/actions/setup_toolchain/action.yml
index 6fd5c9d4e..d15a29f20 100644
--- a/.github/actions/setup_toolchain/action.yml
+++ b/.github/actions/setup_toolchain/action.yml
@@ -30,8 +30,10 @@ runs:
inputs.toolchain != 'arm-gcc' &&
inputs.toolchain != 'esp-idf'
id: set-toolchain-url
+ env:
+ TOOLCHAIN: ${{ inputs.toolchain }}
run: |
- TOOLCHAIN_URL=$(jq -r '."${{ inputs.toolchain }}"' .github/actions/setup_toolchain/toolchain.json)
+ TOOLCHAIN_URL=$(jq -r --arg tc "$TOOLCHAIN" '.[$tc]' .github/actions/setup_toolchain/toolchain.json)
echo "toolchain_url=$TOOLCHAIN_URL"
echo "toolchain_url=$TOOLCHAIN_URL" >> $GITHUB_OUTPUT
shell: bash
@@ -47,11 +49,13 @@ runs:
- name: Set toolchain option
id: set-toolchain-option
+ env:
+ TOOLCHAIN: ${{ inputs.toolchain }}
run: |
BUILD_OPTION=""
- if [[ "${{ inputs.toolchain }}" == *"clang"* ]]; then
+ if [[ "$TOOLCHAIN" == *"clang"* ]]; then
BUILD_OPTION="--toolchain clang"
- elif [[ "${{ inputs.toolchain }}" == "arm-iar" ]]; then
+ elif [[ "$TOOLCHAIN" == "arm-iar" ]]; then
BUILD_OPTION="--toolchain iar"
fi
echo "build_option=$BUILD_OPTION"
diff --git a/.github/actions/setup_toolchain/download/action.yml b/.github/actions/setup_toolchain/download/action.yml
index 514b38f19..af7a9ad4e 100644
--- a/.github/actions/setup_toolchain/download/action.yml
+++ b/.github/actions/setup_toolchain/download/action.yml
@@ -21,29 +21,34 @@ runs:
- name: Install Toolchain
if: steps.cache-toolchain-download.outputs.cache-hit != 'true'
+ env:
+ TOOLCHAIN: ${{ inputs.toolchain }}
+ TOOLCHAIN_URL: ${{ inputs.toolchain_url }}
run: |
- mkdir -p ~/cache/${{ inputs.toolchain }}
+ mkdir -p ~/cache/${TOOLCHAIN}
- if [[ ${{ inputs.toolchain }} == rx-gcc ]]; then
- wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.run
+ if [[ ${TOOLCHAIN} == rx-gcc ]]; then
+ wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.run
chmod +x toolchain.run
- ./toolchain.run -p ~/cache/${{ inputs.toolchain }}/gnurx -y
- elif [[ ${{ inputs.toolchain }} == arm-iar ]]; then
- wget --progress=dot:giga https://netstorage.iar.com/FileStore/STANDARD/001/003/926/iar-lmsc-tools_1.8_amd64.deb -O ~/cache/${{ inputs.toolchain }}/iar-lmsc-tools.deb
- wget --progress=dot:giga ${{ inputs.toolchain_url }} -O ~/cache/${{ inputs.toolchain }}/cxarm.deb
+ ./toolchain.run -p ~/cache/${TOOLCHAIN}/gnurx -y
+ elif [[ ${TOOLCHAIN} == arm-iar ]]; then
+ wget --progress=dot:giga https://netstorage.iar.com/FileStore/STANDARD/001/003/926/iar-lmsc-tools_1.8_amd64.deb -O ~/cache/${TOOLCHAIN}/iar-lmsc-tools.deb
+ wget --progress=dot:giga ${TOOLCHAIN_URL} -O ~/cache/${TOOLCHAIN}/cxarm.deb
else
- wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
- tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
+ wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.tar.gz
+ tar -C ~/cache/${TOOLCHAIN} -xaf toolchain.tar.gz
fi
shell: bash
- name: Setup Toolchain
+ env:
+ TOOLCHAIN: ${{ inputs.toolchain }}
run: |
- if [[ ${{ inputs.toolchain }} == arm-iar ]]; then
- sudo dpkg -i ~/cache/${{ inputs.toolchain }}/iar-lmsc-tools.deb
- sudo apt install -y ~/cache/${{ inputs.toolchain }}/cxarm.deb
+ if [[ ${TOOLCHAIN} == arm-iar ]]; then
+ sudo dpkg -i ~/cache/${TOOLCHAIN}/iar-lmsc-tools.deb
+ sudo apt install -y ~/cache/${TOOLCHAIN}/cxarm.deb
echo >> $GITHUB_PATH "/opt/iar/cxarm/arm/bin"
else
- echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.toolchain }}/*/bin`
+ echo >> $GITHUB_PATH `echo ~/cache/${TOOLCHAIN}/*/bin`
fi
shell: bash
diff --git a/.github/actions/setup_toolchain/espressif/action.yml b/.github/actions/setup_toolchain/espressif/action.yml
index b50ffd41d..e9d645ac8 100644
--- a/.github/actions/setup_toolchain/espressif/action.yml
+++ b/.github/actions/setup_toolchain/espressif/action.yml
@@ -13,8 +13,10 @@ runs:
using: "composite"
steps:
- name: Set DOCKER_ESP_IDF
+ env:
+ TOOLCHAIN: ${{ inputs.toolchain }}
run: |
- DOCKER_ESP_IDF=$HOME/cache/${{ inputs.toolchain }}/docker_image.tar
+ DOCKER_ESP_IDF=$HOME/cache/${TOOLCHAIN}/docker_image.tar
echo "DOCKER_ESP_IDF=$DOCKER_ESP_IDF" >> $GITHUB_ENV
shell: bash
@@ -27,10 +29,12 @@ runs:
- name: Pull and Save Docker Image
if: steps.cache-toolchain-espressif.outputs.cache-hit != 'true'
+ env:
+ TOOLCHAIN_VERSION: ${{ inputs.toolchain_version }}
run: |
- docker pull espressif/idf:${{ inputs.toolchain_version }}
+ docker pull espressif/idf:${TOOLCHAIN_VERSION}
mkdir -p $(dirname $DOCKER_ESP_IDF)
- docker save -o $DOCKER_ESP_IDF espressif/idf:${{ inputs.toolchain_version }}
+ docker save -o $DOCKER_ESP_IDF espressif/idf:${TOOLCHAIN_VERSION}
du -sh $DOCKER_ESP_IDF
shell: bash
@@ -42,7 +46,9 @@ runs:
shell: bash
- name: Tag Local Image
+ env:
+ TOOLCHAIN_VERSION: ${{ inputs.toolchain_version }}
run: |
- docker tag espressif/idf:${{ inputs.toolchain_version }} espressif/idf:tinyusb
+ docker tag espressif/idf:${TOOLCHAIN_VERSION} espressif/idf:tinyusb
docker images
shell: bash
diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml
index 0af8ac42c..7e74f77ce 100644
--- a/.github/workflows/static_analysis.yml
+++ b/.github/workflows/static_analysis.yml
@@ -2,15 +2,30 @@ name: Static Analysis
on:
workflow_dispatch:
push:
- branches:
- - master
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'hw/bsp/**'
+ - '.github/workflows/static_analysis.yml'
pull_request:
- types: [opened, synchronize, reopened]
+ branches: [ master ]
+ paths:
+ - 'src/**'
+ - 'examples/**'
+ - 'hw/bsp/**'
+ - '.github/workflows/static_analysis.yml'
permissions:
actions: read
contents: read
security-events: write
+# pull-requests: write
+# checks: write
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
jobs:
CodeQL:
@@ -50,36 +65,23 @@ jobs:
uses: github/codeql-action/analyze@v4
with:
category: CodeQL
- upload: always
+ upload: false
id: analyze
-# - name: Filter out unwanted errors and warnings
-# uses: advanced-security/filter-sarif@v1
-# with:
-# patterns: |
-# -**:cpp/path-injection
-# -**:cpp/world-writable-file-creation
-# -**:cpp/poorly-documented-function
-# -**:cpp/potentially-dangerous-function
-# -**:cpp/use-of-goto
-# -**:cpp/integer-multiplication-cast-to-long
-# -**:cpp/comparison-with-wider-type
-# -**:cpp/leap-year/*
-# -**:cpp/ambiguously-signed-bit-field
-# -**:cpp/suspicious-pointer-scaling
-# -**:cpp/suspicious-pointer-scaling-void
-# -**:cpp/unsigned-comparison-zero
-# -**/third*party/**
-# -**/3rd*party/**
-# -**/external/**
-# input: ${{ steps.analyze.outputs.sarif-output }}/cpp.sarif
-# output: ${{ steps.analyze.outputs.sarif-output }}/cpp.sarif
-#
-# - name: Upload SARIF
-# uses: github/codeql-action/upload-sarif@v4
-# with:
-# sarif_file: ${{ steps.analyze.outputs.sarif-output }}
-# category: CodeQL
+ - name: Filter SARIF report
+ uses: advanced-security/filter-sarif@v1
+ with:
+ patterns: |
+ -hw/mcu/**
+ -lib/**
+ input: ${{ steps.analyze.outputs.sarif-output }}/cpp.sarif
+ output: ${{ steps.analyze.outputs.sarif-output }}/cpp.sarif
+
+ - name: Upload SARIF
+ uses: github/codeql-action/upload-sarif@v4
+ with:
+ sarif_file: ${{ steps.analyze.outputs.sarif-output }}
+ category: CodeQL
- name: Upload artifact
uses: actions/upload-artifact@v5
@@ -122,7 +124,7 @@ jobs:
mkdir -p build
cmake examples -B build -G Ninja -DBOARD=${{ matrix.board }} -DCMAKE_BUILD_TYPE=MinSizeRel
cmake --build build
- pvs-studio-analyzer analyze -f build/compile_commands.json -j --exclude-path hw/mcu/ --exclude-path lib/
+ pvs-studio-analyzer analyze -R .PVS-Studio/.pvsconfig -f build/compile_commands.json --exclude-path hw/mcu/ --exclude-path lib/ -j
plog-converter -t sarif -o pvs-studio-${{ matrix.board }}.sarif PVS-Studio.log
- name: Upload SARIF