From a0e2003e01e024eb5e6fe6b24d936907b4094971 Mon Sep 17 00:00:00 2001 From: asaky Date: Sat, 16 May 2026 19:15:18 +0300 Subject: [PATCH] add workflow --- .gitea/workflows/ci.yml | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..77f127f --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI Pipeline + +on: + push: + branches: + - main + - master + - ci/setup + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cppcheck + run: sudo apt-get update && sudo apt-get install -y cppcheck + - name: Run cppcheck + run: cppcheck --enable=all src/ tests/ --error-exitcode=1 + + test: + name: Test + runs-on: ubuntu-latest + needs: lint + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: 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 + runs-on: ubuntu-latest + needs: 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: | + cmake -B build -DCMAKE_BUILD_TYPE=Release + cmake --build build + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: calculator + path: build/test_calculator