Update .woodpecker/default.yml
This commit is contained in:
parent
fe5ed97114
commit
0ee40d5346
1 changed files with 42 additions and 14 deletions
|
@ -1,21 +1,49 @@
|
|||
# .woodpecker.yml
|
||||
steps:
|
||||
- name: Build the project
|
||||
image: golang:1.18
|
||||
pipeline:
|
||||
build:
|
||||
image: gcc:13 # Replace with clang or another version if needed
|
||||
environment:
|
||||
CI: true
|
||||
BUILD_DIR: build
|
||||
commands:
|
||||
- echo "Building the project"
|
||||
- go build -o build/my-app .
|
||||
- echo "[*] Installing dependencies"
|
||||
- apt-get update && apt-get install -y cmake make g++ git
|
||||
- echo "[*] Creating build directory"
|
||||
- mkdir -p $BUILD_DIR
|
||||
- cd $BUILD_DIR
|
||||
- echo "[*] Running CMake"
|
||||
- cmake ..
|
||||
- echo "[*] Building project"
|
||||
- make -j$(nproc)
|
||||
|
||||
- name: Release to Gitea
|
||||
test:
|
||||
image: gcc:13
|
||||
environment:
|
||||
BUILD_DIR: build
|
||||
commands:
|
||||
- echo "[*] Running tests"
|
||||
- cd $BUILD_DIR
|
||||
- ctest --output-on-failure || echo "[!] Some tests failed"
|
||||
|
||||
format-check:
|
||||
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
|
||||
|
||||
cache:
|
||||
image: alpine
|
||||
settings:
|
||||
paths:
|
||||
- build
|
||||
|
||||
release:
|
||||
image: woodpeckerci/plugin-gitea-release
|
||||
when:
|
||||
event:
|
||||
- tag # Trigger this step only on tags
|
||||
- tag # Trigger only on tags
|
||||
environment:
|
||||
GITEA_URL: "https://git.xyro.win" # Gitea URL
|
||||
GITEA_TOKEN: "${GITEA_TOKEN}" # Gitea API token stored as a secret
|
||||
REPO_NAME: "MarioDB" # Your repository name
|
||||
TAG_NAME: "${CI_COMMIT_REF}" # Tag name (commit reference)
|
||||
ASSET_PATH: "build/*" # Path to your build artifacts
|
||||
GITEA_URL: "https://git.xyro.win"
|
||||
GITEA_TOKEN: "${GITEA_TOKEN}" # Make sure to set this secret
|
||||
REPO_NAME: "my-repo" # Set your repo name
|
||||
TAG_NAME: "${CI_COMMIT_REF}" # Use the tag name as the version
|
||||
ASSET_PATH: "build/my-cpp-program" # The compiled C++ binary
|
||||
|
|
Loading…
Add table
Reference in a new issue