MarioDB/.woodpecker/default.yml
nyosic 0990b64287
Some checks failed
ci/woodpecker/push/default Pipeline failed
Update .woodpecker/default.yml
2025-04-04 13:07:38 +00:00

51 lines
1.3 KiB
YAML

steps:
# Step 1: Build and Test the C++ Project
- name: build
image: gcc:latest
environment:
CC: gcc
CXX: g++
commands:
# Install CMake
- apt-get update && apt-get install -y cmake
# Cache CMake dependencies
- mkdir -p ~/.cache/woodpecker/cmake
- cmake -DCMAKE_BUILD_TYPE=Release -Bbuild -H.
- cmake --build build --target all
# Run tests
- cd build && ctest --output-on-failure
# Create the release directory
- mkdir -p release
- cp build/your_program release/
# Step 2: Cache Dependencies to Speed Up Builds
- name: cache
image: alpine:latest
commands:
- echo "Caching build dependencies"
- mkdir -p ~/.cache/woodpecker
- mv ~/.cache/woodpecker/cmake /root/.cache/woodpecker/cmake
volumes:
- ~/.cache/woodpecker:/root/.cache/woodpecker
# Step 3: Upload Release Artifact
- name: release
image: woodpeckerci/release:latest
settings:
api_key: ${GITHUB_API_KEY} # Set your API key (GitHub, GitLab, etc.)
target: 'your_project_name' # Replace with your project's name
files:
- release/your_program # Replace with your actual binary name
when:
branch:
- main # Trigger release only on the main branch
trigger:
event:
- push
- pull_request