Skip to content

Commit

Permalink
java 17 for sonacloud. sonarscanner 5.0.1. bumped packages to fix Nod…
Browse files Browse the repository at this point in the history
…e.js 16 actions are deprecated
  • Loading branch information
dzid26 committed Jan 27, 2024
1 parent 69d5e68 commit 70934c5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
42 changes: 24 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on:
workflow_dispatch:
push:
paths:
- ".github/workflows/main.yaml"
- '.github/workflows/**'
- "firmware/src/**/*.c"
- "firmware/src/**/*.h"
- "firmware/*.json"
- "firmware/*.ini"
- "firmware/linker_options_pio.py"
pull_request:
paths:
- ".github/workflows/main.yaml"
- '.github/workflows/**'
- "firmware/src/**/*.c"
- "firmware/src/**/*.h"
- "firmware/*.json"
Expand All @@ -24,21 +24,24 @@ jobs:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
Expand All @@ -52,7 +55,7 @@ jobs:
cd firmware
pio run
- name: Upload firmware
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: firmware
path: firmware/.pio/build/ServoCAN_release/firmware.bin
Expand All @@ -64,7 +67,7 @@ jobs:
cat misra_rules_set_cppcheck.txt
pio check --fail-on-defect high > report.txt
- name: Upload report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pio check report
path: firmware/report.txt
Expand All @@ -74,19 +77,20 @@ jobs:
needs: build_and_check
runs-on: ubuntu-latest
env:
SONAR_SCANNER_VERSION: 4.7.0.2747 # Find the latest version in the "Linux" link on this page:
SONAR_SCANNER_VERSION: 5.0.1.3006 # Find the latest version in the "Linux" link on this page:
# https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/
SONAR_SERVER_URL: "https://sonarcloud.io"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
Expand All @@ -101,19 +105,21 @@ jobs:
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
Expand All @@ -124,7 +130,7 @@ jobs:
cd firmware
pio run -t compiledb
- name: Upload Compilation Database
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: CompilationDB
path: firmware/compile_commands.json
Expand Down
2 changes: 2 additions & 0 deletions firmware/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
sonar.projectKey=dzid26_RetroPilot-SERVO42B
sonar.organization=dzid26
sonar.sources=src/BSP
sonar.cfamily.compile-commands=firmware/compile_commands.json
sonar.sourceEncoding=UTF-8

#Ignore redundant cast warning since it makes satisfying MISRA hard to fix
sonar.issue.ignore.multicriteria.e1.ruleKey=squid:S1905

0 comments on commit 70934c5

Please sign in to comment.