Skip to content

Commit

Permalink
Merge pull request #87 from default-writer:actions
Browse files Browse the repository at this point in the history
[master] updated github actions
  • Loading branch information
default-writer authored Feb 28, 2025
2 parents 197b482 + d9002bf commit 7d6e22e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ name: C/C++ CI

on:
push:
branches: [ "master" ]
branches:
- master
pull_request:
branches: [ "master" ]
types: [opened, synchronize, reopened]

jobs:
build:

environment: dev
name: build
runs-on: ubuntu-latest

steps:
Expand All @@ -17,6 +19,14 @@ jobs:
run: ./bin/init.sh --init --no-update --no-upgrade --lcov --setup --optional
- name: coverage
run: ./bin/coverageall.sh --all
- name: collect
run: gcovr -r . --xml-pretty --output coverage.xml
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
with:
args: >
--define sonar.coverageReportPaths=coverage/coverage.xml
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
## status

[![C/C++ CI](https://github.com/default-writer/c/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/default-writer/c/actions/workflows/c-cpp.yml)
[![Coverage Status](https://coveralls.io/repos/github/default-writer/c/badge.svg?branch=master)](https://coveralls.io/github/default-writer/c?branch=master)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=default-writer_c&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=default-writer_c)
[![Coverage Status](https://coveralls.io/repos/github/default-writer/c/badge.svg?branch=master)](https://coveralls.io/github/default-writer/c?branch=master)

## static analysis

Expand Down
1 change: 1 addition & 0 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ fi
"${pwd}/bin/utils/setup.sh" --clangd --no-update --no-upgrade
"${pwd}/bin/utils/setup.sh" --configuration --no-update --no-upgrade
"${pwd}/bin/utils/setup.sh" --cmake --no-update --no-upgrade
"${pwd}/bin/utils/setup.sh" --gcov --no-update --no-upgrade
"${pwd}/bin/utils/setup.sh" --clang-tidy --no-update --no-upgrade
# "${pwd}/bin/utils/setup.sh" --clang-format --no-update --no-upgrade
# "${pwd}/bin/utils/setup.sh" --nasm
Expand Down
6 changes: 6 additions & 0 deletions bin/utils/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ while (($#)); do
upgrade ${updgradeflags}
;;

"--gcov") # installs gcov/gcovr
update ${updateflags}
apt install -y gcovr
upgrade ${updgradeflags}
;;

"--zsh") # installs zsh
update ${updateflags}
apt install -y zsh
Expand Down
10 changes: 7 additions & 3 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Define separate root directories for sources and tests
sonar.sources = src/
sonar.tests = tests/
sonar.exclusions = tests/**/*,workspace/**/*,resources/**/*
sonar.coverage.exclusions = tests/**/*,workspace/**/*,resources/**/*
sonar.coverageReportPaths = coverage/,workspace/coverage/
sonar.exclusions = tests/**/*
sonar.coverage.exclusions = tests/**/*
sonar.coverageReportPaths = coverage/coverage.xml

# Mandatory properties
sonar.projectKey = default-writer_c
sonar.organization = default-writer

0 comments on commit 7d6e22e

Please sign in to comment.