-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.38 KB
/
ci.yml
File metadata and controls
56 lines (46 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# .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