From 6ed7f80a5c70285f5c87690808ac24bfdcf6f638 Mon Sep 17 00:00:00 2001 From: dpantaleoni Date: Wed, 24 Sep 2025 11:23:12 -0700 Subject: [PATCH 1/4] set up ci for verifying compilation, closes #2 --- .github/workflows/compile.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/compile.yaml diff --git a/.github/workflows/compile.yaml b/.github/workflows/compile.yaml new file mode 100644 index 0000000..1e9e4f8 --- /dev/null +++ b/.github/workflows/compile.yaml @@ -0,0 +1,24 @@ +name: Compile C++ + +on: + push: + branches: "devops" + 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 5dcd89f90a1e4ba04979a489417239c2db3eba1e Mon Sep 17 00:00:00 2001 From: dpantaleoni Date: Wed, 24 Sep 2025 11:32:02 -0700 Subject: [PATCH 2/4] added badge to README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bbcf55a..d1b9855 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # autovalidate +[![Compile C++](https://github.com/dpantaleoni/autovalidate/actions/workflows/compile.yaml/badge.svg)](https://github.com/dpantaleoni/autovalidate/actions/workflows/compile.yaml) + 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 d1caf901e951c10e4a5eee5c39ff158e196abac0 Mon Sep 17 00:00:00 2001 From: dpantaleoni Date: Wed, 24 Sep 2025 11:37:38 -0700 Subject: [PATCH 3/4] added Makefile --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8856a47 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +CC=g++ +all: + $(CC) -Wall *.cpp + +.PHONY: clean + +clean: + rm -f *.o* From fa8ecbdb07211614274439bd17a91a5c0d893fad Mon Sep 17 00:00:00 2001 From: dpantaleoni Date: Wed, 24 Sep 2025 11:42:29 -0700 Subject: [PATCH 4/4] added termnation upon nothing, closes #1 --- main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 982d05f..9096202 100644 --- a/main.cpp +++ b/main.cpp @@ -19,6 +19,9 @@ int main(){ pick = rand() % 4; cout << "What are you listening to?\n"; getline(cin,input); + if ( input == "nothing") { + return 0; + } cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ @@ -29,4 +32,4 @@ int main(){ }while( input != "nothing" ); return 0; -} \ No newline at end of file +}