diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..62fa279 --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,25 @@ +name: Build C++ + +on: + push: + branches: [ "devops", "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential g++ + + - name: Compile C++ program + run: | + g++ -Wall -Wextra -std=c++11 main.cpp -o main + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e4fe1b --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app \ No newline at end of file diff --git a/README.md b/README.md index bbcf55a..fcc48ac 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# autovalidate +[![C++ CI](https://github.com/er02869/autovalidate/actions/workflows/actions.yml/badge.svg)](https://github.com/er02869/autovalidate/actions/workflows/actions.yml) -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 +# Autovalidate \ No newline at end of file diff --git a/main b/main new file mode 100644 index 0000000..cf44240 Binary files /dev/null and b/main differ diff --git a/main.cpp b/main.cpp index d9884f9..50a1cbb 100644 --- a/main.cpp +++ b/main.cpp @@ -22,8 +22,16 @@ int main(){ cout << "What are you listening to?\n"; getline(cin,input); transform(input.begin(), input.end(), input.begin(), [](unsigned char c){ return std::tolower(c); }); - cout << VALIDATION[pick] << "! Let's listen to more\n"; + + + if(input == "nothing" || input == ""){ + cout << "Oh... okay. Bye!\n"; + cout << "Testing for actions.yml agai\n"; + return 0; + } + cout << VALIDATION[pick] << "! Let's listen to more\n"; + do{ cout << "What's next?\n"; getline(cin,input);