Skip to content

feat(workflow): add run-all-problems.yml #1

feat(workflow): add run-all-problems.yml

feat(workflow): add run-all-problems.yml #1

name: Build and Run All Problems
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-and-run:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential
- name: Configure project
run: cmake -S . -B build
- name: Build all
run: cmake --build build -- -j$(nproc)
- name: Run all executables (stop on failure)
run: |
set -e
echo "Find and run all problems..."
find build -type f -perm /111 | while read exe; do
if [[ "$(basename "$exe")" =~ ^[0-9]+- ]]; then
echo "▶️ Run: $exe"
if ! "$exe"; then
echo "❌ Failed: $exe"
exit 1
fi
fi
done