Skip to content

Commit

Permalink
Merge pull request #1 from RitheeshBaradwaj/chore/add-build-workflow
Browse files Browse the repository at this point in the history
Chore/add build workflow
  • Loading branch information
RitheeshBaradwaj authored Feb 26, 2023
2 parents edde474 + 571aab7 commit e6beaf3
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 7 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-cpp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build C++ Project

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ lcov googletest
cd /usr/src/googletest
sudo cmake CMakeLists.txt
sudo make
sudo cp lib/*.a /usr/lib
cd ~
- name: Checkout code
uses: actions/checkout@v2

- name: Build project
run: |
ls -al
chmod 755 build.sh
./build.sh -c
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: wordprocessor-build
path: |
_build/
_bin/
_test_reports/
_test_coverage/
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: wordprocessor-build
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# set the below values correctly if required
set(GTEST_LOCAL_PATH "/home/user/googletest")
set(GTEST_LOCAL_PATH "/usr/src/googletest")
set(GTEST_ROOT "${GTEST_LOCAL_PATH}/googletest")
set(GTEST_LIBRARY "${GTEST_LOCAL_PATH}/build/lib/libgtest.a")
set(GTEST_MAIN_LIBRARY "${GTEST_LOCAL_PATH}/build/lib/libgtest_main.a")
set(GTEST_LIBRARY "${GTEST_LOCAL_PATH}/lib/libgtest.a")
set(GTEST_MAIN_LIBRARY "${GTEST_LOCAL_PATH}/lib/libgtest_main.a")
set(GTEST_INCLUDE_DIRS "${GTEST_ROOT}/include")
set(GMOCK_INCLUDE_DIRS "${GTEST_LOCAL_PATH}/googlemock/include")

Expand Down
51 changes: 47 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The WordProcessor application is a C++ program that reads a list of ASCII words

This ReadME file contains information on how to install and run the application, as well as the application's design page.

## Status

[![Build WorkProcessor Project](https://github.com/RitheeshBaradwaj/WordProcessor/actions/workflows/build-cpp.yaml/badge.svg?branch=main)](https://github.com/RitheeshBaradwaj/WordProcessor/actions/workflows/build-cpp.yaml)

## Design

The detailed design of the WordProcessor application can be found on the [Design Page](docs/DESIGN.md).
Expand Down Expand Up @@ -31,14 +35,53 @@ All the test results including binaries, unit test results, code coverage report

* [Run Steps](README.md#run-steps)

## Install Build Dependencies

The following are the steps to install dependencies for Wordprocessor applications:

1. Update the package index on your Ubuntu system:

```shell
sudo apt-get update
```

2. Install the cmake, g++ compiler, lcov coverage tool, Google Test and Google Mock libraries and headers using apt-get:

```shell
sudo apt-get install -y googletest
```

3. Once the installation is complete, navigate to the /usr/src/googletest directory:

```shell
cd /usr/src/googletest
```

4. Build the Google Test and Google Mock libraries:

```shell
sudo cmake CMakeLists.txt
sudo make
```

5. Copy the compiled library files to the system library directory:

```shell
sudo cp lib/*.a /usr/lib
```

## Installation Guide

The following instructions explain how to install the WordProcessor application:

1. Clone the repository by running git clone https://github.com/example/WordProcessor.git.
2. Change to the project directory by running cd WordProcessor.
3. Install the required dependencies by running `sudo apt-get install -y g++ lcov libgtest-dev`.
4. Build the application by running `make`.
1. Install the dependencies mentioned above.
2. Clone the repository by running git clone https://github.com/example/WordProcessor.git.
3. Change to the project directory by running cd WordProcessor.
4. Build the application by running `build.sh`.

```shell
./build.sh -c
```

## Suitable Compiler

Expand Down

0 comments on commit e6beaf3

Please sign in to comment.