This commit is contained in:
parent
d204448bd6
commit
9bce5bb39f
1 changed files with 11 additions and 10 deletions
|
@ -1,5 +1,6 @@
|
||||||
pipeline:
|
# .woodpecker.yml
|
||||||
build:
|
steps:
|
||||||
|
- name: Build the C++ project
|
||||||
image: gcc:13 # Replace with clang or another version if needed
|
image: gcc:13 # Replace with clang or another version if needed
|
||||||
environment:
|
environment:
|
||||||
BUILD_DIR: build
|
BUILD_DIR: build
|
||||||
|
@ -14,7 +15,7 @@ pipeline:
|
||||||
- echo "[*] Building project"
|
- echo "[*] Building project"
|
||||||
- make -j$(nproc)
|
- make -j$(nproc)
|
||||||
|
|
||||||
test:
|
- name: Run tests
|
||||||
image: gcc:13
|
image: gcc:13
|
||||||
environment:
|
environment:
|
||||||
BUILD_DIR: build
|
BUILD_DIR: build
|
||||||
|
@ -23,27 +24,27 @@ pipeline:
|
||||||
- cd $BUILD_DIR
|
- cd $BUILD_DIR
|
||||||
- ctest --output-on-failure || echo "[!] Some tests failed"
|
- ctest --output-on-failure || echo "[!] Some tests failed"
|
||||||
|
|
||||||
format-check:
|
- name: Check code formatting
|
||||||
image: gcc:13
|
image: gcc:13
|
||||||
commands:
|
commands:
|
||||||
- apt-get update && apt-get install -y clang-format
|
- apt-get update && apt-get install -y clang-format
|
||||||
- echo "[*] Checking code formatting..."
|
- echo "[*] Checking code formatting..."
|
||||||
- find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' | xargs clang-format --dry-run --Werror
|
- find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' | xargs clang-format --dry-run --Werror
|
||||||
|
|
||||||
cache:
|
- name: Cache build directory
|
||||||
image: alpine
|
image: alpine
|
||||||
settings:
|
settings:
|
||||||
paths:
|
paths:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
release:
|
- name: Create release in Gitea
|
||||||
image: woodpeckerci/plugin-gitea-release
|
image: woodpeckerci/plugin-gitea-release
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- tag # Trigger only on tags
|
- tag # Trigger only on tags
|
||||||
environment:
|
environment:
|
||||||
GITEA_URL: "https://git.xyro.win"
|
GITEA_URL: "https://git.xyro.win"
|
||||||
GITEA_TOKEN: "${GITEA_TOKEN}" # Make sure to set this secret
|
GITEA_TOKEN: "${GITEA_TOKEN}" # Make sure to set this secret in the Woodpecker UI
|
||||||
REPO_NAME: "my-repo" # Set your repo name
|
REPO_NAME: "my-repo" # Replace with your actual repository name
|
||||||
TAG_NAME: "${CI_COMMIT_REF}" # Use the tag name as the version
|
TAG_NAME: "${CI_COMMIT_REF}" # Use the commit reference (tag name)
|
||||||
ASSET_PATH: "build/my-cpp-program" # The compiled C++ binary
|
ASSET_PATH: "build/my-cpp-program" # Path to the compiled C++ binary
|
||||||
|
|
Loading…
Add table
Reference in a new issue