Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build (Release)

on:
push:
branches:
- main
- develop
- feature*
- release*

pull_request:
types:
- edited
- opened
- reopened
- synchronize

branches:
- main
- develop
- feature*
- release*

jobs:
build-release:
name: Build (Release)
runs-on: ubuntu-22.04
permissions: read-all
container:
image: ghcr.io/aosedge/aos-core-build:latest
options: "--entrypoint /usr/bin/bash"
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}

steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Build
run: |
./build.sh build --build-type Release
20 changes: 6 additions & 14 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test
name: Build (Debug) and test

on:
push:
Expand Down Expand Up @@ -36,22 +36,14 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
Comment thread
mlohvynenko marked this conversation as resolved.

- name: Static analysis
run: |
./build.sh lint

- name: Install build wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v6

- name: Build (Release)
run: |
./build.sh build --build-type Release
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v7

- name: Build (Debug)
run: |
Expand All @@ -62,14 +54,14 @@ jobs:
./build.sh coverage

- name: Upload codecov report
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage.total

- name: SonarQube analysis (on push)
if: github.event_name == 'push'
uses: SonarSource/sonarqube-scan-action@v6
uses: SonarSource/sonarqube-scan-action@v7
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Expand All @@ -80,7 +72,7 @@ jobs:

- name: SonarQube analysis (on pull request)
if: github.event_name == 'pull_request_target'
uses: SonarSource/sonarqube-scan-action@v6
uses: SonarSource/sonarqube-scan-action@v7
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Log in to github container registry
uses: docker/login-action@v3
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Lint

on:
push:
branches:
- main
- develop
- feature*
- release*

pull_request:
types:
- edited
- opened
- reopened
- synchronize

branches:
- main
- develop
- feature*
- release*

jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
permissions: read-all
container:
image: ghcr.io/aosedge/aos-core-build:latest
options: "--entrypoint /usr/bin/bash"
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}

steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Static analysis
run: |
./build.sh lint
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ conan_setup() {
conan install ./conan/ --output-folder build --settings=build_type="$ARG_BUILD_TYPE" --build=missing
}

build_project() {
cmake_configure() {
conan_setup

print_next_step "Run cmake configure"

cmake -S . -B build \
Expand All @@ -68,6 +70,10 @@ build_project() {
-DWITH_COVERAGE=ON \
-DWITH_MBEDTLS=ON \
-DWITH_OPENSSL=ON
}

build_project() {
cmake_configure

if [ "$ARG_CI_FLAG" == "true" ]; then
print_next_step "Run build-wrapper and build (CI mode)"
Expand Down Expand Up @@ -118,7 +124,6 @@ build_target() {
clean_build
fi

conan_setup
Comment thread
mlohvynenko marked this conversation as resolved.
build_project
}

Expand All @@ -141,6 +146,8 @@ run_coverage() {
}

run_lint() {
cmake_configure

Comment thread
mlohvynenko marked this conversation as resolved.
print_next_step "Run static analysis (cppcheck)"

cppcheck --enable=all --inline-suppr --std=c++17 --error-exitcode=1 \
Expand Down
Loading