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
27 changes: 27 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: C++ CI with Docker

on: [push, pull_request]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Docker
run: |
sudo apt-get update
sudo apt-get install -y docker.io

# Optional: If you want to clone the cpp-container repository inside your CI job
# or if your Dockerfile is in your HelloWorld repo, adjust accordingly
- name: Build Docker Image
run: |
docker build -t cpp-container .

- name: Run Tests in Docker
run: |
docker run -v ${{ github.workspace }}:/usr/src -w /usr/src cpp-container sh ./test_runner.sh

34 changes: 30 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
#include <iostream>
#include <string>
#include <vector>

int main() {
std::vector<std::string> favoriteFoods;
std::string input;

std::cout << "Enter your favorite food one by one. Type 'done' when finished.\n";

while (true) {
std::cout << "What's your favorite food? ";
std::getline(std::cin, input);

// Check if the user is done entering foods
if (input == "done") {
break;
}

// Add the food to the list
favoriteFoods.push_back(input);
}

// Print the list of favorite foods
std::cout << "\nYour favorite foods are:\n";
for (const auto& food : favoriteFoods) {
std::cout << "- " << food << "\n";
}

return 0;
}

int main(){
std::cout<<"Hello World!\n";
return 0;
}