feat: menambahkan algoritma djikstra graf #402
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
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!'] | |
}) | |