-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b41e0d7
commit 24fc108
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Run Google Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Checkout the code | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Install Dependencies | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y build-essential cmake g++ libgtest-dev | ||
# Build and install Google Test | ||
cd /usr/src/googletest | ||
sudo cmake . | ||
sudo make | ||
sudo cp -r include/gtest /usr/local/include | ||
sudo cp -r lib/*.a /usr/local/lib | ||
# Step 3: Build and Run Tests | ||
- name: Build and run tests | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
./test_output # Replace with the name of your test executable if different |