Skip to content

Commit

Permalink
Add Sonarqube analysis (SonarCloud) (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymiiOrg authored May 4, 2024
1 parent baa1d5b commit 92aa72c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/build-test-and-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
run: echo "name=date::$(date +'%Y-%m-%dT%H%M')" >> $GITHUB_OUTPUT

- name: Install build dependencies
run: sudo apt -y update && sudo apt -y install libpcap-dev libsdl-dev netcat-openbsd
Expand Down Expand Up @@ -46,25 +46,31 @@ jobs:
BUILD_DATE: ${{ steps.date.outputs.date }}

linux-x86-gcc:
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-22.04"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H%M')"
run: echo "name=date::$(date +'%Y-%m-%dT%H%M')" >> $GITHUB_OUTPUT

- name: Install gcovr
run: pip install gcovr

- name: Install build dependencies
run: sudo apt -y update && sudo apt -y install libpcap-dev libsdl-dev netcat-openbsd
run: sudo apt -y update && sudo apt -y install libpcap-dev libsdl1.2-dev netcat-openbsd

- name: Create build environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall"
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall" -DCMAKE_EXPORT_COMPILE_COMMANDS=1

- name: Build
working-directory: ${{runner.workspace}}/build
Expand All @@ -86,6 +92,18 @@ jobs:
env:
BUILD_DATE: ${{ steps.date.outputs.date }}

- name: Collect coverage into one XML report
working-directory: ${{runner.workspace}}/build
run: |
gcovr --sonarqube > coverage.xml
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner
linux-arm-gcc-crosscompile:
runs-on: "ubuntu-20.04"
continue-on-error: true
Expand Down Expand Up @@ -139,8 +157,6 @@ jobs:
steps:
- uses: actions/checkout@v2



- name: Create npcap sdk folder
working-directory: ${{runner.workspace}}\
run: mkdir pcap
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Please read the [Installation Guide](https://github.com/lenticularis39/axpbox/wi
- OpenVMS host support was dropped
- es40 and es40_cfg were merged into one executable (axpbox)
- The code was cleaned to compile without warnings on most compilers
- Code modernizing, replacing POCO framework parts by native C++ counterparts not available in 2008 (std::threads, etc)
- Code modernizing, replacing POCO framework parts by native C++11 counterparts not available in 2008 (std::threads, etc)
- Incorporate various patches from other es40 forks, for example, added MC146818 periodic interrupt to allow netbsd to boot and install, skip_memtest for faster booting.
- Bug fixes, less segfaults, overall less crashes.
- [More](https://github.com/lenticularis39/axpbox/wiki/) documentation and usage information on the various features and operating systems
Expand All @@ -48,5 +48,4 @@ Please read the [Installation Guide](https://github.com/lenticularis39/axpbox/wi
- Multiple CPU system emulation
- Running on big endian platforms
- Some SCSI and IDE commands
- Networking for a longer time (breaks after a couple minutes)
- Copying large files between IDE CD-ROM to IDE hard drive (this usually doesn't affect OpenVMS installation)
16 changes: 16 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sonar.projectKey=rve_axpbox
sonar.organization=rve

# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=AXPBox
sonar.projectVersion=1.1.3


# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=src/

# use complation database
sonar.cfamily.compile-commands=../build/compile_commands.json

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8

0 comments on commit 92aa72c

Please sign in to comment.