Skip to content

Commit d7c4bf1

Browse files
committed
add IAR CStat to static_analysis.yml
1 parent 5818db4 commit d7c4bf1

File tree

8 files changed

+67
-185
lines changed

8 files changed

+67
-185
lines changed

.circleci/config2.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ commands:
3434
chmod +x toolchain.run
3535
./toolchain.run -p ~/cache/<< parameters.toolchain >>/gnurx -y
3636
elif [[ << parameters.toolchain >> == arm-iar ]]; then
37+
wget --progress=dot:giga https://netstorage.iar.com/FileStore/STANDARD/001/003/926/iar-lmsc-tools_1.8_amd64.deb -O ~/cache/<< parameters.toolchain >>/iar-lmsc-tools.deb
3738
wget --progress=dot:giga $toolchain_url -O ~/cache/<< parameters.toolchain >>/toolchain.deb
3839
else
3940
wget --progress=dot:giga $toolchain_url -O toolchain.tar.gz
@@ -44,6 +45,7 @@ commands:
4445
# Add toolchain to PATH
4546
if [[ << parameters.toolchain >> == arm-iar ]]; then
4647
# Install IAR since we only cache deb file
48+
sudo dpkg -i ~/cache/<< parameters.toolchain >>/iar-lmsc-tools.deb
4749
sudo dpkg --ignore-depends=libusb-1.0-0 -i ~/cache/<< parameters.toolchain >>/toolchain.deb
4850
echo "export PATH=$PATH:/opt/iar/cxarm/arm/bin" >> $BASH_ENV
4951
else

.github/actions/setup_toolchain/download/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ runs:
2929
chmod +x toolchain.run
3030
./toolchain.run -p ~/cache/${{ inputs.toolchain }}/gnurx -y
3131
elif [[ ${{ inputs.toolchain }} == arm-iar ]]; then
32+
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
3233
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O ~/cache/${{ inputs.toolchain }}/cxarm.deb
3334
else
3435
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
@@ -39,7 +40,8 @@ runs:
3940
- name: Setup Toolchain
4041
run: |
4142
if [[ ${{ inputs.toolchain }} == arm-iar ]]; then
42-
sudo apt-get install -y ~/cache/${{ inputs.toolchain }}/cxarm.deb
43+
sudo dpkg -i ~/cache/${{ inputs.toolchain }}/iar-lmsc-tools.deb
44+
sudo apt install -y ~/cache/${{ inputs.toolchain }}/cxarm.deb
4345
echo >> $GITHUB_PATH "/opt/iar/cxarm/arm/bin"
4446
else
4547
echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.toolchain }}/*/bin`

.github/actions/setup_toolchain/toolchain.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"msp430-gcc": "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2",
66
"riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz",
77
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run",
8-
"arm-iar": "https://netstorage.iar.com/FileStore/STANDARD/001/003/583/cxarm-9.60.4.deb"
8+
"arm-iar": "https://netstorage.iar.com/FileStore/STANDARD/001/003/723/cxarm-9.70.1.deb"
99
}

.github/workflows/codeql-buildscript.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/codeql.yml

Lines changed: 0 additions & 138 deletions
This file was deleted.

.github/workflows/fail_on_error.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/static_analysis.yml

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
board:
22-
- 'raspberry_pi_pico'
22+
- 'metro_m4_express'
2323
steps:
2424
- name: Checkout TinyUSB
2525
uses: actions/checkout@v4
@@ -88,12 +88,13 @@ jobs:
8888
path: ${{ steps.analyze.outputs.sarif-output }}
8989

9090
PVS-Studio:
91+
if: github.repository_owner == 'hathach'
9192
runs-on: ubuntu-latest
9293
strategy:
9394
fail-fast: false
9495
matrix:
9596
board:
96-
- 'stm32h743eval'
97+
- 'raspberry_pi_pico'
9798
steps:
9899
- name: Checkout TinyUSB
99100
uses: actions/checkout@v4
@@ -119,7 +120,7 @@ jobs:
119120
- name: Analyze
120121
run: |
121122
mkdir -p build
122-
cmake examples -B build -G Ninja -DBOARD=${{ matrix.board }} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=MinSizeRel
123+
cmake examples -B build -G Ninja -DBOARD=${{ matrix.board }} -DCMAKE_BUILD_TYPE=MinSizeRel
123124
cmake --build build
124125
pvs-studio-analyzer analyze -f build/compile_commands.json -j --exclude-path hw/mcu/ --exclude-path lib/
125126
plog-converter -t sarif -o pvs-studio-${{ matrix.board }}.sarif PVS-Studio.log
@@ -137,14 +138,15 @@ jobs:
137138
path: pvs-studio-${{ matrix.board }}.sarif
138139

139140
SonarQube:
141+
if: github.repository_owner == 'hathach'
140142
runs-on: ubuntu-latest
141143
env:
142144
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
143145
strategy:
144146
fail-fast: false
145147
matrix:
146148
board:
147-
- 'metro_m4_express'
149+
- 'stm32h743eval'
148150
steps:
149151
- name: Checkout TinyUSB
150152
uses: actions/checkout@v4
@@ -166,7 +168,7 @@ jobs:
166168

167169
- name: Run Build Wrapper
168170
run: |
169-
cmake examples -B build -G Ninja -DBOARD=${{ matrix.board }} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=MinSizeRel
171+
cmake examples -B build -G Ninja -DBOARD=${{ matrix.board }} -DCMAKE_BUILD_TYPE=MinSizeRel
170172
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/
171173
172174
- name: SonarQube Scan
@@ -177,3 +179,46 @@ jobs:
177179
# Consult https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
178180
args: >
179181
--define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json
182+
183+
IAR-CStat:
184+
if: github.repository_owner == 'hathach'
185+
runs-on: ubuntu-latest
186+
strategy:
187+
fail-fast: false
188+
matrix:
189+
board:
190+
- 'b_g474e_dpow1'
191+
steps:
192+
- name: Checkout TinyUSB
193+
uses: actions/checkout@v4
194+
195+
- name: Get Dependencies
196+
uses: ./.github/actions/get_deps
197+
with:
198+
arg: -b${{ matrix.board }}
199+
200+
- name: Setup Toolchain
201+
uses: ./.github/actions/setup_toolchain
202+
with:
203+
toolchain: 'arm-iar'
204+
205+
- name: Run IAR C-STAT Analysis
206+
env:
207+
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
208+
run: |
209+
# CMake run post build to generate C-STAT SARIF report
210+
mkdir -p build
211+
cmake examples -B build -G Ninja -DBOARD=${{ matrix.board }} -DTOOLCHAIN=iar -DIAR_CSTAT=1 -DCMAKE_BUILD_TYPE=MinSizeRel
212+
cmake --build build
213+
214+
- name: Upload SARIF
215+
uses: github/codeql-action/upload-sarif@v4
216+
with:
217+
sarif_file: build/cstat_sarif
218+
category: IAR-CStat
219+
220+
- name: Upload artifact
221+
uses: actions/upload-artifact@v5
222+
with:
223+
name: iar-cstat-${{ matrix.board }}
224+
path: build/cstat_sarif

tools/make_release.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@
4444
with open(f_library_json, 'w') as f:
4545
f.write(fdata)
4646

47+
###################
48+
# sonar-project.properties
49+
###################
50+
f_sonar_properties = 'sonar-project.properties'
51+
with open(f_sonar_properties) as f:
52+
fdata = f.read()
53+
fdata = re.sub(r'(sonar\.projectVersion=)\d+\.\d+\.\d+', rf'\1{version}', fdata)
54+
55+
with open(f_sonar_properties, 'w') as f:
56+
f.write(fdata)
57+
4758
###################
4859
# docs/info/changelog.rst
4960
###################

0 commit comments

Comments
 (0)