|
7 | 7 | pull_request: |
8 | 8 | branches: [ master ] |
9 | 9 |
|
| 10 | + |
10 | 11 | jobs: |
11 | | - format: |
12 | | - runs-on: ubuntu-latest |
13 | | - container: |
14 | | - image: ghcr.io/milsanore/tradercppbuild:v1.6 |
15 | | - steps: |
16 | | - - name: Checkout repository |
17 | | - uses: actions/checkout@v4 |
18 | | - - name: clang-format |
19 | | - run: hooks/check_clang_format.sh |
20 | | - |
21 | | - build_and_test: |
22 | | - needs: format |
23 | | - runs-on: ubuntu-latest |
24 | | - container: |
25 | | - image: ghcr.io/milsanore/tradercppbuild:v1.6 |
26 | | - steps: |
27 | | - - name: Checkout full history |
28 | | - uses: actions/checkout@v4 |
29 | | - with: |
30 | | - fetch-depth: 0 |
31 | | - - name: Restore Conan cache |
32 | | - uses: actions/cache@v4 |
33 | | - with: |
34 | | - path: ~/.conan2 |
35 | | - key: ${{ runner.os }}-conan-${{ hashFiles('conanfile.*') }} |
36 | | - restore-keys: | |
37 | | - ${{ runner.os }}-conan- |
38 | | - - name: Install conan dependencies |
39 | | - run: | |
40 | | - set -e |
41 | | - rm -rf build |
42 | | - conan profile detect --force |
43 | | - conan install . --build=missing -s build_type=Debug |
44 | | - - name: Build |
45 | | - run: | |
46 | | - set -e |
47 | | - cmake --preset=debug |
48 | | - cmake --build --preset=debug |
49 | | - - name: Test |
50 | | - run: | |
51 | | - set -e |
52 | | - ctest --preset=debug |
53 | | - # `lcov` FOR CODECOV |
54 | | - lcov --gcov-tool gcov --capture --directory . --output-file lcov.info \ |
55 | | - --rc geninfo_unexecuted_blocks=1 \ |
56 | | - --ignore-errors mismatch |
57 | | - lcov --remove lcov.info '/home/*' '/usr/*' 'tests/*' --output-file lcov_filtered.info |
58 | | - # `gcovr` FOR SONARQUBE |
59 | | - gcovr -r . --exclude 'tests/*' --sonarqube -o sonar-coverage.xml |
60 | | - - name: Configure git safe directory |
61 | | - run: git config --global --add safe.directory $(pwd) |
62 | | - - name: clang-tidy (delta) |
63 | | - run: | |
64 | | - set -e |
65 | | - git fetch --no-tags origin master |
66 | | - diff=$(git diff -U0 origin/master...HEAD -- '*.cpp') |
67 | | - if [ -z "$diff" ]; then |
68 | | - echo "No changes to lint." |
69 | | - exit 0 |
70 | | - fi |
71 | | - echo "$diff" | clang-tidy-diff-18.py -p1 -path build/Debug |
72 | | - - name: Upload coverage to Codecov |
73 | | - uses: codecov/codecov-action@v5 |
74 | | - with: |
75 | | - token: ${{ secrets.CODECOV_TOKEN }} |
76 | | - files: lcov_filtered.info |
77 | | - continue-on-error: true |
78 | | - - name: SonarQube Scan |
79 | | - uses: SonarSource/sonarqube-scan-action@v6.0.0 |
80 | | - env: |
81 | | - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
82 | | - with: |
83 | | - args: > |
84 | | - -Dsonar.coverageReportPaths=sonar-coverage.xml |
85 | | - -Dsonar.projectBaseDir=. |
86 | | - -Dsonar.sources=src |
87 | | - -Dsonar.tests=tests |
88 | | - continue-on-error: true |
| 12 | + call-reusable: |
| 13 | + uses: ./.github/workflows/clean_build_test.yml |
0 commit comments