Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Compile

on:
push:
branches: "ci/cd"
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
23 changes: 23 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build 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: g++ -std=c++17 main.cpp
6 changes: 5 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ int main(){
pick = rand() % VALIDATION.size();
cout << "What are you listening to?\n";
getline(cin,input);
if(input == "nothing")
return 0;
transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); });
cout << VALIDATION[pick] << "! Let's listen to more\n";

do{
cout << "What's next?\n";
getline(cin,input);
pick = rand() % 4;
if(input == "nothing")
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;
}
}