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 + 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* 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). 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 +}