feature: dp pattern 1 fibonacci, tribonacci added #80
This file contains hidden or 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
name: datastructures-algorithms-ci-cd | |
on: | |
push: | |
branches: [ main, release ] | |
pull_request: | |
branches: [ main, release ] | |
jobs: | |
lint-build-test: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
- name: Install dependencies | |
shell: pwsh | |
run: | | |
choco install cmake -y | |
choco install ninja -y | |
choco install llvm -y | |
- name: Configure CMake | |
shell: pwsh | |
run: cmake -S . -B build -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
- name: Run clang-tidy | |
shell: pwsh | |
run: | | |
clang-tidy --version | |
$files = Get-ChildItem -Recurse -Path source -Include *.cpp,*.cc,*.cxx -File | |
# These source/.* files would be checked using .clang-tidy maintained at projectroot | |
foreach ($file in $files) { | |
Write-Host "Running clang-tidy on source $($file.FullName)" | |
clang-tidy -p build "$($file.FullName)" --warnings-as-errors=* | |
} | |
- name: Build | |
shell: pwsh | |
run: cmake --build build | |
- name: Run tests | |
shell: pwsh | |
run: ctest --test-dir build --output-on-failure |