diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9b55a16 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: "**" + 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++ main.cpp diff --git a/README.md b/README.md index 121b94d..9207b8c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ + +[![Build C++](https://github.com/mateoguzv/MyFave/actions/workflows/main.yml/badge.svg)](https://github.com/mateoguzv/MyFave/actions/workflows/main.yml) + + # MyFave This is a simple C++ command line application to maintain a list of your favorites. diff --git a/main.cpp b/main.cpp index 64467b5..b36cf24 100644 --- a/main.cpp +++ b/main.cpp @@ -19,13 +19,13 @@ int main(){ } getline(cin,input); favorites.push_back(input); - }while( input != "DONE" ); - + cout << "Your favorite list:\n"; for(int i = 0; i < favorites.size() -1; i++) { cout << favorites.at(i) << endl; } + }while( input != "DONE" ); return 0; -} \ No newline at end of file +}