diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0a99591..f8a515d 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -3,50 +3,55 @@ name: CI Pipeline on: push: branches: - - main - - master - - ci/setup + - main # Запуск только при пуше в main jobs: lint: - name: Lint + name: 1. Lint (Static Analysis) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Install cppcheck - run: sudo apt-get update && sudo apt-get install -y cppcheck + run: | + sudo apt-get update + sudo apt-get install -y cppcheck + - name: Run cppcheck run: | - cppcheck --enable=all --inconclusive -I include/ --suppress=missingIncludeSystem src/ tests/ --error-exitcode=1 + cppcheck --enable=all -I include/ --suppress=missingIncludeSystem src/ tests/ --error-exitcode=1 test: - name: Test + name: 2. Test (Unit Tests) runs-on: ubuntu-latest - needs: lint + needs: lint # Запускается только если Lint прошел успешно steps: - uses: actions/checkout@v4 + - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y cmake build-essential - - name: Configure - run: cmake -B build - - name: Build - run: cmake --build build - - name: Run tests run: | - cd build - ctest --output-on-failure --verbose - ./test_calculator + sudo apt-get update + sudo apt-get install -y cmake build-essential + + - name: Build and Test + run: | + cmake -B build + cmake --build build + cd build && ctest --output-on-failure build: - name: Build + name: 3. Build (Release) runs-on: ubuntu-latest - needs: test + needs: test # Запускается только если Test прошел успешно steps: - uses: actions/checkout@v4 + - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y cmake build-essential - - name: Build + run: | + sudo apt-get update + sudo apt-get install -y cmake build-essential + + - name: Build Release run: | cmake -B build -DCMAKE_BUILD_TYPE=Release - cmake --build build - # Блок Upload artifact удален \ No newline at end of file + cmake --build build \ No newline at end of file