51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
steps:
|
|
- name: Build the C++ project
|
|
image: gcc:13
|
|
environment:
|
|
BUILD_DIR: build
|
|
commands:
|
|
- echo "[*] Installing dependencies"
|
|
- apt-get update && apt-get install -y cmake make g++ git
|
|
- echo "[*] Cloning repository"
|
|
- git clone https://git.xyro.win/nyosic/MarioDB.git /woodpecker/src
|
|
- echo "[*] Creating build directory"
|
|
- mkdir -p $BUILD_DIR
|
|
- cd $BUILD_DIR
|
|
- echo "[*] Running CMake"
|
|
- cmake /woodpecker/src
|
|
- echo "[*] Building project"
|
|
- make -j$(nproc)
|
|
|
|
- name: Run tests
|
|
image: gcc:13
|
|
environment:
|
|
BUILD_DIR: build
|
|
commands:
|
|
- echo "[*] Running tests"
|
|
- cd $BUILD_DIR
|
|
- ctest --output-on-failure || echo "[!] Some tests failed"
|
|
|
|
- name: Check code formatting
|
|
image: gcc:13
|
|
commands:
|
|
- apt-get update && apt-get install -y clang-format
|
|
- echo "[*] Checking code formatting..."
|
|
- find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' | xargs clang-format --dry-run --Werror
|
|
|
|
- name: Cache build directory
|
|
image: alpine
|
|
settings:
|
|
paths:
|
|
- build
|
|
|
|
- name: Create release in Gitea
|
|
image: woodpeckerci/plugin-gitea-release
|
|
when:
|
|
event:
|
|
- tag # Trigger only on tags
|
|
environment:
|
|
GITEA_URL: "https://git.xyro.win"
|
|
GITEA_TOKEN: "${GITEA_TOKEN}" # Make sure to set this secret in the Woodpecker UI
|
|
REPO_NAME: "MarioDB" # Replace with your actual repository name
|
|
TAG_NAME: "${CI_COMMIT_REF}" # Use the commit reference (tag name)
|
|
ASSET_PATH: "build/main" # Path to the compiled C++ binary
|