Skip to content

Close #289: Add checking for valid RUUVISESSION cookie when auth_type is set to 'allow' #50

Close #289: Add checking for valid RUUVISESSION cookie when auth_type is set to 'allow'

Close #289: Add checking for valid RUUVISESSION cookie when auth_type is set to 'allow' #50

Workflow file for this run

name: SonarCloud Analysis
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: bw-output # Directory where build-wrapper output will be placed
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
submodules: true
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Check Python version
run: |
python --version
python3 --version
python3.8 --version
- name: Set Python 3.8 as default
run: |
echo "alias python=python3.8" >> ~/.bashrc
source ~/.bashrc
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc g++ cmake make ninja-build
sudo apt-get install -y git wget libncurses-dev flex bison gperf python3 python3-pip python3-setuptools python3-serial python3-click python3-cryptography python3-future python3-pyparsing python3-pyelftools ccache libffi-dev libssl-dev
sudo apt-get install -y gcovr
sudo apt-get install -y locales
sudo locale-gen de_DE.UTF-8
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Set IDF_PATH
run: echo "IDF_PATH=$HOME/esp/esp-idf" >> $GITHUB_ENV
- name: Cache ESP-IDF and tools
id: cache-esp-idf
uses: actions/cache@v4
with:
path: |
~/esp
~/.espressif
key: esp-idf-${{ hashFiles('.github/workflows/sonar-scan.yml') }}
- name: Download and install ESP-IDF v4.2.2
if: steps.cache-esp-idf.outputs.cache-hit != 'true'
run: |
mkdir ~/esp
cd ~/esp
git clone --recursive --branch v4.2.2 https://github.com/espressif/esp-idf.git
cd $IDF_PATH
./install.sh --python `which python3.8`
- name: Run build-wrapper
run: |
source $HOME/esp/esp-idf/export.sh
python --version
which python
pip install bincopy
printenv | grep IDF
idf.py --version
cd examples/default_demo
mkdir build
cd build
build-wrapper-linux-x86-64 --out-dir ./${{ env.BUILD_WRAPPER_OUT_DIR }} cmake -DCMAKE_BUILD_TYPE=Debug -G "Ninja" ..
build-wrapper-linux-x86-64 --out-dir ./${{ env.BUILD_WRAPPER_OUT_DIR }} ninja
cd ../../..
- name: Run test with coverage
run: |
cd tests
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage" -G "Ninja" ..
ninja
ctest
cd ../..
gcovr -r . --sonarqube -o coverage.xml
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner -X \
--define sonar.cfamily.build-wrapper-output="examples/default_demo/build/${{ env.BUILD_WRAPPER_OUT_DIR }}" \
--define sonar.coverageReportPaths=coverage.xml \
--define sonar.cfamily.threads=$(nproc)