From f7ecbd3d5ae2968896ab31a32fc73b47a01c7bd0 Mon Sep 17 00:00:00 2001 From: Vincent Roberson <89275572+bincent0929@users.noreply.github.com> Date: Thu, 25 Sep 2025 20:11:20 +0000 Subject: [PATCH 1/5] adds gitignore closes #69 new file: .gitignore modified: main.cpp --- .gitignore | 1 + main.cpp | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cba7efc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +a.out diff --git a/main.cpp b/main.cpp index 9cc1de5..ad1ab72 100644 --- a/main.cpp +++ b/main.cpp @@ -5,25 +5,31 @@ using std::cout, std::cin, std::endl, std::string, std::vector; int main() { - string input = ""; + string input; vector favorites; cout << "At any time, type DONE to stop recording favorites.\n"; - do + bool first_run = true; + while (input != "DONE") { + if (first_run == false) { + favorites.push_back(input); + } + else { + first_run = false; + } + if( favorites.size() == 0 ) cout << "What is your favorite?\n"; - else cout << "What is your next favorite?\n"; getline(cin,input); - favorites.push_back(input); - }while( input != "DONE" ); + } cout << "Your favorite list:\n"; - for(int i = 0; i < favorites.size() -1; i++) + for(int i = 0; i < favorites.size(); i++) // whole list printed cout << favorites.at(i) << endl; return 0; From 1e8c897d50bb4b58367cc5981e1a069d75d3d714 Mon Sep 17 00:00:00 2001 From: Vincent Roberson <89275572+bincent0929@users.noreply.github.com> Date: Thu, 25 Sep 2025 20:16:34 +0000 Subject: [PATCH 2/5] adds a github workflow new file: .github/workflows modified: README.md --- .github/workflows | 24 ++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows diff --git a/.github/workflows b/.github/workflows new file mode 100644 index 0000000..698dd2d --- /dev/null +++ b/.github/workflows @@ -0,0 +1,24 @@ +name: Build C++ Project + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: code compile test + uses: actions/checkout@v4 + + - name: Install g++ + run: sudo apt-get update && sudo apt-get install -y g++ + + - name: Compile project + run: g++ main.cpp --std=c++17 -o MyFave + + - name: Run executable (optional) + run: ./MyFave \ No newline at end of file diff --git a/README.md b/README.md index 121b94d..7a65492 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # MyFave + + This is a simple C++ command line application to maintain a list of your favorites. ## Getting Started From d104918172f680b02037f8a7eb00bd96fc64bf10 Mon Sep 17 00:00:00 2001 From: Vincent Roberson <89275572+bincent0929@users.noreply.github.com> Date: Thu, 25 Sep 2025 20:17:37 +0000 Subject: [PATCH 3/5] removed messed up workflow deleted: .github/workflows --- .github/workflows | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows diff --git a/.github/workflows b/.github/workflows deleted file mode 100644 index 698dd2d..0000000 --- a/.github/workflows +++ /dev/null @@ -1,24 +0,0 @@ -name: Build C++ Project - -on: - push: - branches: [ main, develop ] - pull_request: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: code compile test - uses: actions/checkout@v4 - - - name: Install g++ - run: sudo apt-get update && sudo apt-get install -y g++ - - - name: Compile project - run: g++ main.cpp --std=c++17 -o MyFave - - - name: Run executable (optional) - run: ./MyFave \ No newline at end of file From f62efc92f9c2decbb9db0182f861fabc025c9903 Mon Sep 17 00:00:00 2001 From: Vincent Roberson <89275572+bincent0929@users.noreply.github.com> Date: Thu, 25 Sep 2025 13:18:06 -0700 Subject: [PATCH 4/5] Add GitHub Actions workflow for C++ project build --- .github/workflows/main.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..df76d02 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,24 @@ +name: Build C++ Project + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: code compile test + uses: actions/checkout@v4 + + - name: Install g++ + run: sudo apt-get update && sudo apt-get install -y g++ + + - name: Compile project + run: g++ main.cpp --std=c++17 -o MyFave + + - name: Run executable (optional) + run: ./MyFave From e40119752e55f30c84542f4574346b5c33d9eaa8 Mon Sep 17 00:00:00 2001 From: Vincent Roberson <89275572+bincent0929@users.noreply.github.com> Date: Thu, 25 Sep 2025 20:20:15 +0000 Subject: [PATCH 5/5] workflow config added to a yaml and added to README closes #68 modified: README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a65492..07377a6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MyFave - +[![Build C++ Project](https://github.com/bincent0929/vr-MyFave/actions/workflows/main.yml/badge.svg?branch=main&event=status)](https://github.com/bincent0929/vr-MyFave/actions/workflows/main.yml) This is a simple C++ command line application to maintain a list of your favorites.