diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..5553307 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,16 @@ +name: Build C++ + +on: + push: + branches: "**" + pull_request: + branches: [ main devops ] + +jobs: + build: + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build project + run: g++ -std=c++17 main.cpp \ No newline at end of file diff --git a/README.md b/README.md index bbcf55a..ab39779 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,6 @@ 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). + +[![.github/workflows/compile.yml](https://github.com/sarah-gaskov/autovalidate/actions/workflows/compile.yml/badge.svg)](https://github.com/sarah-gaskov/autovalidate/actions/workflows/compile.yml) diff --git a/main.cpp b/main.cpp index d9884f9..e40ddac 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include using std::cout; using std::cin; @@ -24,13 +25,13 @@ int main(){ transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); cout << VALIDATION[pick] << "! Let's listen to more\n"; - do{ + while( input != "nothing" ){ cout << "What's next?\n"; getline(cin,input); transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); pick = rand() % VALIDATION.size(); cout << VALIDATION[pick] << "!\n"; - }while( input != "nothing" ); + } return 0; } \ No newline at end of file