Skip to content

feat: menambahkan algoritma djikstra graf #400

feat: menambahkan algoritma djikstra graf

feat: menambahkan algoritma djikstra graf #400

Workflow file for this run

# cpp testing menggunakan clang-tidy-10 dan clang-format
# informasi dan dokumentasi clang-tidy
# https://clang.llvm.org/extra/clang-tidy/
# informasi dan dokumentasi clang-format
# https://clang.llvm.org/docs/ClangFormat.html
name: Cpp Testing
on: [push, pull_request]
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
permissions:
contents: write
jobs:
TestingUtama:
name: cpp test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- name: install requirement
run: |
sudo apt-get -qq update
sudo apt-get -qq install clang-tidy clang-format
- name: git
run: |
git config --global user.name github-actions[bot]
git config --global user.email '[email protected]'
- name: format filename
run: |
wget https://raw.githubusercontent.com/bellshade/unitesting-script/main/filename_formatter.sh
chmod +x filename_formatter.sh
./filename_formatter.sh .cpp, .hpp
- name: mengambil file yang telah dirubah
run: |
git branch
git diff --diff-filter=dr --name-only origin/main > git_diff.txt
echo "file diubah-- `cat git_diff.txt`"
- name: Konfigurasi statik lint cpp
run: cmake -B build -S . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: cek lint hasil modifikasi
shell: bash
run: python3 .linter/file_linter.py
- name: commit
run: |
git commit -am "chore: clang formatter and clang-tidy fixing ${GITHUB_SHA:8}" || true
git push origin HEAD:$GITHUB_REF || true
build:
name: cek compile
runs-on: ${{ matrix.os }}
needs: [TestingUtama]
permissions:
pull-requests: write
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: build cpp
run: |
cmake -B ./build -S .
cmake --build build --parallel 4
- name: tambah label jika fail
uses: actions/github-script@v6
if: ${{ failure() && matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request'}}
with:
script: |
github.rest.issue.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['testing fail!']
})