Skip to content
Open

Cicd #425

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
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build C++

on:
push:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install compiler
run: |
sudo apt-get update
sudo apt-get install -y g++

- name: Build project
run: g++ -std=c++17 -O2 -Wall -Wextra -o app main.cpp

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[![Build C++](https://github.com/aakhan10/MyFirstExample/actions/workflows/build.yml/badge.svg)](https://github.com/aakhan10/MyFirstExample/actions/workflows/build.yml)

# My First Example

8 changes: 8 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ int main()
cout << "Addition: " << x + y << endl;
cout << "Subtraction: " << x - y << endl;
cout << "Multiplication: " << x * y << endl;
if (y == 0)
{
cout << "Division: Dividing by zero is not a number." << endl;
}
else
{
cout << "Division: " << x / y << endl;
}
cout << "Division: " << x / y << endl;
cout << "Remainder: " << x % y << endl;
cout << "Square Root: " << sqrt(x) << endl;
Expand Down