diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..4f29599 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: [ main ] + 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@v3 + - name: Build project + run: g++ main.cpp -std=c++17 -o firstIO diff --git a/README.md b/README.md index a547296..c4e4bd5 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,7 @@ g++ main.cpp and if it compiles successfully, run it with `./a.out` -To exit the container, type `exit` \ No newline at end of file +To exit the container, type `exit` + +Status workflow (x06): +[![Build C++](https://github.com/LeoMalinen2/CppMath/actions/workflows/main.yml/badge.svg)](https://github.com/LeoMalinen2/CppMath/actions/workflows/main.yml) diff --git a/main.cpp b/main.cpp index 47b917d..ae2ff6f 100644 --- a/main.cpp +++ b/main.cpp @@ -18,6 +18,8 @@ int main(){ cout<< (first-second) << endl; cout<< "Multiplication: "<< first << "*" << second << "="; cout<< (first*second) << endl; + cout<< "Division: "<< first << "/" << second << "="; + cout<< (first/second) << endl; return 0; } \ No newline at end of file