From 4c3e2696f33e24d58fd4c6a1fde01330b5a8f05c Mon Sep 17 00:00:00 2001 From: Aaron Partridge Date: Wed, 24 Sep 2025 11:22:17 -0700 Subject: [PATCH 1/6] Fixed: Now terminates whenever user enters 'nothing', closes #1 --- main.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/main.cpp b/main.cpp index 982d05f..7d62335 100644 --- a/main.cpp +++ b/main.cpp @@ -3,30 +3,37 @@ #include #include -using std::cout; using std::cin; +using std::cout; using std::endl; using std::string; using std::vector; -const vector VALIDATION = {"Cool","Great","Perfect","Beautiful"}; +const vector VALIDATION = {"Cool", "Great", "Perfect", "Beautiful"}; -int main(){ +int main() +{ string input; int pick; srand(time(0)); pick = rand() % 4; cout << "What are you listening to?\n"; - getline(cin,input); + getline(cin, input); + if (input == "nothing") + return 0; + cout << VALIDATION[pick] << "! Let's listen to more\n"; - do{ + do + { cout << "What's next?\n"; - getline(cin,input); + getline(cin, input); + if (input == "nothing") + break; pick = rand() % 4; cout << VALIDATION[pick] << "!\n"; - }while( input != "nothing" ); + } while (input != "nothing"); return 0; } \ No newline at end of file From 8b8d3b879371b4cf19cddfe48cecf5ccd998907e Mon Sep 17 00:00:00 2001 From: Aaron Partridge Date: Wed, 24 Sep 2025 11:38:15 -0700 Subject: [PATCH 2/6] added workflow to compile, closes #2 --- .github/workflows/build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 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..1e01d06 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +name: Build C++ + +on: + push: + branches: '**' + pull_request: + branches: [cicd] + +jobs: + compile: + runs-on: ubuntu-latest + steps: + - name: compile + run: g++ -std=c++17 main.cpp + build: + needs: compile + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build project + run: make clean && make From 1f66050ec4b5e6a4d7d943408e551dc7cbf54015 Mon Sep 17 00:00:00 2001 From: Aaron Partridge Date: Wed, 24 Sep 2025 11:46:41 -0700 Subject: [PATCH 3/6] added status badge --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bbcf55a..a3b34b0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # autovalidate +[![Build C++](https://github.com/apartridge16/autovalidate/actions/workflows/build.yml/badge.svg)](https://github.com/apartridge16/autovalidate/actions/workflows/build.yml) + 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 3901613d4f8dd35014773ae385f105e5a2838de0 Mon Sep 17 00:00:00 2001 From: Aaron Partridge Date: Wed, 24 Sep 2025 11:50:49 -0700 Subject: [PATCH 4/6] Fix: ci/cd pipline compiles now --- .github/workflows/build.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e01d06..e67d4d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,21 +1,15 @@ -name: Build C++ +name: compile on: push: branches: '**' pull_request: - branches: [cicd] + branches: [main] jobs: - compile: - runs-on: ubuntu-latest - steps: - - name: compile - run: g++ -std=c++17 main.cpp build: - needs: compile runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build project - run: make clean && make + - name: compile + run: g++ -std=c++17 main.cpp From fad65e69ccf30d74f258db662bab38a92f811433 Mon Sep 17 00:00:00 2001 From: Aaron Partridge Date: Wed, 24 Sep 2025 11:53:59 -0700 Subject: [PATCH 5/6] Fixed compile ci/cd --- .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 e67d4d3..7c049be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: compile on: push: - branches: '**' + branches: 'devops' pull_request: branches: [main] From b236fdb8b8dcaab2567039b66400dddeb03243de Mon Sep 17 00:00:00 2001 From: Aaron Partridge Date: Wed, 24 Sep 2025 11:56:37 -0700 Subject: [PATCH 6/6] fix ci/cd pipeline --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c049be..bfa3065 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: compile on: push: - branches: 'devops' + branches: '**' pull_request: - branches: [main] + branches: [cicd] jobs: build: