Skip to content

Commit 8f66ca3

Browse files
authored
Update ci.yml
1 parent 539e4f5 commit 8f66ca3

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
name: C++ CI
44

5-
# This action will trigger on every push to the main branch
65
on:
76
push:
87
branches: [ "main" ]
@@ -11,23 +10,25 @@ on:
1110

1211
jobs:
1312
build:
14-
# Use the latest version of Ubuntu as the runner
1513
runs-on: ubuntu-latest
1614

1715
steps:
18-
# 1. Check out your repository code so the workflow can access it
16+
# 1. Check out your repository code
1917
- name: Checkout code
2018
uses: actions/checkout@v4
2119

22-
# 2. The build step
23-
- name: Build the project
24-
run: |
25-
echo "Starting build..."
26-
g++ -std=c++17 -pthread -Iinclude src/*.cpp -o hybrid_cache
27-
echo "Build finished."
20+
# 2. Cache the 'obj' directory (Optional but recommended)
21+
- name: Cache build objects
22+
id: cache-objects
23+
uses: actions/cache@v4
24+
with:
25+
path: obj
26+
key: ${{ runner.os }}-build-${{ hashFiles('**/Makefile', '**/src/*.cpp', '**/include/*.h') }}
2827

29-
# 3. (Optional) A step to run your executable to make sure it works
28+
# 3. Build the project using the Makefile
29+
- name: Build with make
30+
run: make
31+
32+
# 4. Run the program with a capacity argument
3033
- name: Run the program
31-
run: |
32-
echo "Running executable..."
33-
./hybrid_cache
34+
run: ./bin/hybrid_cache 10 # <-- THE FIX IS HERE

0 commit comments

Comments
 (0)