Обновить .gitea/workflows/ci.yml
This commit is contained in:
@@ -3,50 +3,55 @@ name: CI Pipeline
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main # Запуск только при пуше в main
|
||||||
- master
|
|
||||||
- ci/setup
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: 1. Lint (Static Analysis)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install cppcheck
|
- 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
|
- name: Run cppcheck
|
||||||
run: |
|
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:
|
test:
|
||||||
name: Test
|
name: 2. Test (Unit Tests)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: lint
|
needs: lint # Запускается только если Lint прошел успешно
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- 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: |
|
run: |
|
||||||
cd build
|
sudo apt-get update
|
||||||
ctest --output-on-failure --verbose
|
sudo apt-get install -y cmake build-essential
|
||||||
./test_calculator
|
|
||||||
|
- name: Build and Test
|
||||||
|
run: |
|
||||||
|
cmake -B build
|
||||||
|
cmake --build build
|
||||||
|
cd build && ctest --output-on-failure
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: 3. Build (Release)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: test
|
needs: test # Запускается только если Test прошел успешно
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get update && sudo apt-get install -y cmake build-essential
|
run: |
|
||||||
- name: Build
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y cmake build-essential
|
||||||
|
|
||||||
|
- name: Build Release
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -DCMAKE_BUILD_TYPE=Release
|
cmake -B build -DCMAKE_BUILD_TYPE=Release
|
||||||
cmake --build build
|
cmake --build build
|
||||||
# Блок Upload artifact удален
|
|
||||||
Reference in New Issue
Block a user