From 5c90456f8fdfbe392e48c8f51ec51db073617a7f Mon Sep 17 00:00:00 2001 From: itsmecharliev <45504444+itsmecharliev@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:18:09 -0700 Subject: [PATCH 1/8] fixed termination upon 'nothing' closes #1 --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 982d05f..8941bdd 100644 --- a/main.cpp +++ b/main.cpp @@ -19,9 +19,9 @@ int main(){ pick = rand() % 4; cout << "What are you listening to?\n"; getline(cin,input); - cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ + cout << VALIDATION[pick] << "! Let's listen to more\n"; cout << "What's next?\n"; getline(cin,input); pick = rand() % 4; @@ -29,4 +29,4 @@ int main(){ }while( input != "nothing" ); return 0; -} \ No newline at end of file +} From e79f84282b87abf1b3a61f9dcd483214d53a28f2 Mon Sep 17 00:00:00 2001 From: itsmecharliev <45504444+itsmecharliev@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:25:34 -0700 Subject: [PATCH 2/8] Added Makefile to build main using C++ standard 17 --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..423b122 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +CC=g++ +all: + $(CC) -std=c++17 main.cpp + +.PHONY: clean + +clean: + rm -f *.o* From 74ba0e230c7e169977eb6258e78cc6d242d92aff Mon Sep 17 00:00:00 2001 From: itsmecharliev <45504444+itsmecharliev@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:26:59 -0700 Subject: [PATCH 3/8] Added CI workflow closes #2 --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1ddab56 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: "**" + pull_request: + branches: [ main ] + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y -f build-essential g++ cmake + build: + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build project + run: make clean && make From 353ab3b625501e1184c325e10318b5f669e460ee Mon Sep 17 00:00:00 2001 From: itsmecharliev <45504444+itsmecharliev@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:31:11 -0700 Subject: [PATCH 4/8] Added status badge to README file --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bbcf55a..4933178 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ +[![Build C++](https://github.com/itsmecharliev/autovalidate/actions/workflows/build.yml/badge.svg)](https://github.com/itsmecharliev/autovalidate/actions/workflows/build.yml) # autovalidate I like that app too! -This repo is compatible with the [cpp-container docker container](https://github.com/ChicoState/cpp-container). \ No newline at end of file +This repo is compatible with the [cpp-container docker container](https://github.com/ChicoState/cpp-container). From a15c0dc6a8375f3350bf92a6f59f1a8e4c8f09f1 Mon Sep 17 00:00:00 2001 From: itsmecharliev <45504444+itsmecharliev@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:32:56 -0700 Subject: [PATCH 5/8] Adjusted build file to trigger for 'devops' branch specifically --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ddab56..62ccb7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build C++ on: push: - branches: "**" + branches: "devops" pull_request: branches: [ main ] From 343d2a6bbba40b61ef023eb15b912268c4a9c157 Mon Sep 17 00:00:00 2001 From: itsmecharliev <45504444+itsmecharliev@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:38:04 -0700 Subject: [PATCH 6/8] Renamed CI workflow to be 'compile' --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62ccb7f..3c27e58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build C++ +name: compile on: push: From e2b5314d6fcca821b7be45e1086d2a012bacea34 Mon Sep 17 00:00:00 2001 From: itsmecharliev <45504444+itsmecharliev@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:42:15 -0700 Subject: [PATCH 7/8] Fixed termination issue Changed do while to while loop --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 8941bdd..bc67aa9 100644 --- a/main.cpp +++ b/main.cpp @@ -20,13 +20,13 @@ int main(){ cout << "What are you listening to?\n"; getline(cin,input); - do{ + while ( input != "nothing" ){ cout << VALIDATION[pick] << "! Let's listen to more\n"; cout << "What's next?\n"; getline(cin,input); pick = rand() % 4; cout << VALIDATION[pick] << "!\n"; - }while( input != "nothing" ); + } return 0; } From f5d852c9a756c181842bd48167acf60df8c1e4f4 Mon Sep 17 00:00:00 2001 From: itsmecharliev <45504444+itsmecharliev@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:44:16 -0700 Subject: [PATCH 8/8] Fixed case where validation occured twice in while loop --- main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/main.cpp b/main.cpp index bc67aa9..cf19215 100644 --- a/main.cpp +++ b/main.cpp @@ -25,7 +25,6 @@ int main(){ cout << "What's next?\n"; getline(cin,input); pick = rand() % 4; - cout << VALIDATION[pick] << "!\n"; } return 0;