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

on:
push:
branches: [ main, master, practice-branch ]
pull_request:
branches: [ main, master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

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

- name: Build project
run: |
if [ -f main.cpp ]; then
g++ -o main main.cpp
echo "Build successful"
else
echo "No main.cpp found, skipping build"
fi
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![C++ Build](https://github.com/sesantilla/git-practice/actions/workflows/build.yml/badge.svg)](https://github.com/sesantilla/git-practice/actions/workflows/build.yml)
# git-practice

This is a typo:
Remove this and replace it with this text:
HEY! You should read me! I'm a README.md file!
11 changes: 11 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <iostream>

// This is a simple C++ program that prints "Hello, World!" to the console.
main ()
{
// Output "Hello, World!" to the console
std::cout << "Hello, World!" << std::endl;

// Return 0 to indicate that the program ended successfully
return 0;
}