Skip to content

add badge

add badge #4

Workflow file for this run

# .github/workflows/ci.yml
# 1. Workflow Name
name: C++ CI for mygit
# 2. Triggers
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
# 3. Jobs
jobs:
build-and-test:
# 4. Runner
runs-on: ubuntu-latest
# 5. Steps
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libssl-dev zlib1g-dev libcurl4-openssl-dev
- name: Install cpr library
run: |
git clone https://github.com/libcpr/cpr.git
cd cpr
mkdir build && cd build
cmake .. -DCPR_USE_SYSTEM_CURL=ON
cmake --build .
sudo cmake --install .
- name: Make scripts executable
run: |
chmod +x build.sh
chmod +x tests/*.sh
- name: Build the project
run: ./build.sh
- name: Configure Git for test runner
run: |
git config --global user.name "CI Test Bot"
git config --global user.email "ci-bot@github.com"
# CORRECTED STEP: Run tests from within the 'tests' directory
- name: Run tests
# This tells the runner to execute the following command
# inside the 'tests' directory.
working-directory: ./tests
run: ./run_all_tests.sh