diff --git a/.github/workflows/compile.yaml b/.github/workflows/compile.yaml new file mode 100644 index 0000000..1e12785 --- /dev/null +++ b/.github/workflows/compile.yaml @@ -0,0 +1,23 @@ +name: compile + +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: g++ -std=c++17 main.cpp diff --git a/main.cpp b/main.cpp index 690cf17..b3d8736 100644 --- a/main.cpp +++ b/main.cpp @@ -24,6 +24,7 @@ int main(){ pick = rand() % VALIDATION.size(); cout << "What are you listening to?\n"; input = get_input_in_lowercase(); + if( input == "nothing" ) {return 0;} cout << VALIDATION[pick] << "! Let's listen to more\n"; do{ @@ -41,4 +42,5 @@ string get_input_in_lowercase(){ getline(cin,in); transform(in.begin(), in.end(), in.begin(), [](unsigned char c){ return std::tolower(c); }); return in; -} \ No newline at end of file +} +