build(deps): bump actions/checkout from 3 to 4 #59
Workflow file for this run
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
name: Build | |
on: push | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Run pre-commit | |
uses: pre-commit/action@v3.0.0 | |
- name: Run commitlint | |
uses: wagoid/commitlint-github-action@v4 | |
build: | |
name: Build | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
compiler: gcc | |
cc: gcc | |
cxx: g++ | |
- os: ubuntu-latest | |
compiler: clang | |
cc: clang | |
cxx: clang++ | |
- os: windows-latest | |
compiler: msvc | |
cc: cl | |
cxx: cl | |
runs-on: ${{ matrix.os }} | |
needs: [lint] | |
env: | |
CC: ${{ matrix.cc }} | |
CXX: ${{ matrix.cxx }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install clang | |
if: matrix.compiler == 'clang' | |
uses: egor-tensin/setup-clang@v1.4 | |
- name: Install msbuild | |
if: matrix.os == 'windows-latest' | |
uses: ilammy/msvc-dev-cmd@v1.12.1 | |
- name: Install meson, ninja and gcovr | |
run: pip install meson ninja gcovr | |
- name: Configure | |
run: meson setup build | |
- name: Compile | |
run: meson compile -C build | |
- name: Run tests | |
run: meson test -C build | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: [build] | |
env: | |
SONAR_SCANNER_VERSION: 4.7.0.2747 | |
SONAR_SERVER_URL: "https://sonarcloud.io" | |
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Setup Sonar Scanner | |
uses: jwidauer/setup-sonar-scanner@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install meson, ninja and gcovr | |
run: pip install meson ninja gcovr | |
- name: Run build-wrapper | |
run: | | |
meson build -Db_coverage=true | |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} meson compile -C build | |
- name: Run tests and generate coverage report | |
run: | | |
cd build | |
ninja test | |
ninja coverage | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
sonar-scanner \ | |
--define sonar.host.url="${{ env.SONAR_SERVER_URL }}" \ | |
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \ | |
--define sonar.coverageReportPaths=build/meson-logs/sonarqube.xml \ | |
--define sonar.coverage.exclusions=examples/* | |
docs: | |
name: Generate documentation | |
runs-on: ubuntu-latest | |
needs: [test] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate documentation | |
uses: mattnotmitt/doxygen-action@1.9.4 | |
with: | |
working-directory: docs | |
doxyfile-path: Doxyfile | |
- name: Upload documentation as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docs | |
path: docs/html | |
- name: Deploy documentation | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs/html |