Skip to content

Commit 5c725ea

Browse files
authored
workflow: split the workflow contextually
1 parent 67b2c7e commit 5c725ea

3 files changed

Lines changed: 44 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: CI
22

33
on:
44
push:
5+
paths-ignore:
6+
- 'README.md'
57
workflow_dispatch:
68
schedule:
79
- cron: '20 16 * * *'
@@ -17,11 +19,6 @@ jobs:
1719
name: Build tutorial
1820
runs-on: ubuntu-24.04
1921
container: ghcr.io/iarsystems/arm
20-
permissions:
21-
security-events: write
22-
actions: read
23-
contents: read
24-
packages: read
2522
steps:
2623
- name: Checkout project
2724
uses: actions/checkout@v4
@@ -33,15 +30,3 @@ jobs:
3330
- name: CMake - Build
3431
working-directory: tutorial
3532
run: cmake --build build --verbose
36-
37-
- name: IAR C-STAT Static Analysis
38-
working-directory: tutorial
39-
run: |
40-
ichecks --all --output build/checks.manifest
41-
icstat --checks build/checks.manifest --db build/cstat.db --sarif_dir build analyze -- iccarm tutorial.c
42-
43-
- name: Upload SARIF
44-
uses: github/codeql-action/upload-sarif@v3
45-
with:
46-
sarif_file: tutorial/build/tutorial.c.sarif
47-
category: cstat-analysis

.github/workflows/codeql.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Code Analysis
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'README.md'
7+
workflow_dispatch:
8+
schedule:
9+
- cron: '30 16 * * *'
10+
11+
# Set a new GitHub Actions Secret named IAR_LMS_BEARER_TOKEN
12+
# for your repository. The secret is then propagated to an
13+
# Environment variable used for all jobs within this workflow
14+
env:
15+
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
16+
17+
jobs:
18+
tutorial:
19+
name: Analyze tutorial
20+
runs-on: ubuntu-24.04
21+
container: ghcr.io/iarsystems/arm
22+
permissions:
23+
security-events: write
24+
actions: read
25+
contents: read
26+
packages: read
27+
steps:
28+
- name: Checkout project
29+
uses: actions/checkout@v4
30+
31+
- name: IAR C-STAT Static Analysis
32+
working-directory: tutorial
33+
run: |
34+
ichecks --all --output build/checks.manifest
35+
icstat --checks build/checks.manifest --db build/cstat.db --sarif_dir build analyze -- iccarm tutorial.c
36+
37+
- name: Upload SARIF
38+
uses: github/codeql-action/upload-sarif@v3
39+
with:
40+
sarif_file: tutorial/build/tutorial.c.sarif
41+
category: cstat-analysis

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Building CMake projects with IAR
22

3-
[![CI](https://github.com/iarsystems/cmake-tutorial/actions/workflows/ci.yml/badge.svg)](https://github.com/iarsystems/cmake-tutorial/actions/workflows/ci.yml)
3+
[![CI](https://github.com/iarsystems/cmake-tutorial/actions/workflows/ci.yml/badge.svg)](https://github.com/iarsystems/cmake-tutorial/actions/workflows/ci.yml) [![Code Analysis](https://github.com/iarsystems/cmake-tutorial/actions/workflows/codeql.yml/badge.svg)](https://github.com/iarsystems/cmake-tutorial/actions/workflows/codeql.yml)
44

55
CMake is an open-source, cross-platform family of tools maintained and supported by Kitware. Among its many features, it essentially provides [Makefile Generators](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id11) and [Ninja Generators](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id12) which compose scripts for cross-compiling C/C++ embedded software projects based on one or more `CMakeLists.txt` configuration files.
66

0 commit comments

Comments
 (0)