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
73 changes: 18 additions & 55 deletions .github/workflows/pre-commit-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,22 @@ on:
branches: [main, 'feat/*']

jobs:
check-code-with-cpp-linter-action:
name: Check code with cpp-linter-action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cpp-linter/cpp-linter-action@v2
id: linter
container-test-job:
runs-on: ubuntu-latest
container:
image: node:18
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
tidy-checks: 'cppcoreguidelines-*'
# The following value will only update a single comment
# in a pull request's thread. Set it to false to disable the comment.
# Set it to true to post a new comment (and delete the old comment).
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}

- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: |
echo "Some files failed the linting checks!"
exit 1

check-code-with-universum:
name : Check code with universum
runs-on: ubuntu-latest
steps:

- name: Setup python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install dependency
run: |
pip install universum
pip install gitpython
sudo apt-get install clang-format
sudo apt-get install git

- name: Universum
run:
python -u -m universum
--vcs-type="ghactions"
--ghactions-payload="@${{ github.event_path }}"
--ghactions-token="${{ secrets.GITHUB_TOKEN }}"
--report-to-review
--no-diff
--fail-unsuccessful

- name: Collect artifacts
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: artifacts
path: artifacts
NODE_ENV: development
ports:
- 80
volumes:
- my_docker_volume:/volume_mount
options: --cpus 1
steps:
- name: Check for dockerenv file
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)
- name: Print github_event file
run: |
echo $GITHUB_EVENT_PATH
cat $GITHUB_EVENT_PATH

13 changes: 13 additions & 0 deletions show_sum/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <iostream>

int main( void ) {
size_t one;
size_t two;
size_t sum;
std::cout << "Enter the first number: ";
std::cin >> one;
std::cout << "Enter the second number: ";
std::cin >> two;
sum = one + two;
std::cout << "The sum of " << one << " and " << two << " is " << sum << std::endl;
}