Skip to content

Commit

Permalink
Add a yamlint workflow
Browse files Browse the repository at this point in the history
And make sure all yaml files validate.

Squashed commit of the following:

commit c6e2c23
Author: Paul Colby <[email protected]>
Date:   Sat Oct 5 18:36:48 2024 +1000

    Correct Bash syntax

    Because leading indents still result in new-line characters in
    folded block scalars.

commit e6e9b6f
Author: Paul Colby <[email protected]>
Date:   Sat Oct 5 17:03:46 2024 +1000

    Correct workflow syntax

commit 3e0662e
Author: Paul Colby <[email protected]>
Date:   Sat Oct 5 17:02:46 2024 +1000

    Correct workflow step syntax

commit cd645c0
Author: Paul Colby <[email protected]>
Date:   Sat Oct 5 17:01:42 2024 +1000

    Correct indentation

commit b229fd5
Author: Paul Colby <[email protected]>
Date:   Sat Oct 5 16:58:21 2024 +1000

    Add a yamlint workflow

    And make sure all yaml files validate.
  • Loading branch information
pcolby committed Oct 5, 2024
1 parent 7d2d077 commit b53ecff
Show file tree
Hide file tree
Showing 8 changed files with 676 additions and 617 deletions.
File renamed without changes.
12 changes: 6 additions & 6 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
api:
- changed-files:
- any-glob-to-any-file: 'include/**'
- any-glob-to-any-file: 'include/**'

cmake:
- changed-files:
- any-glob-to-any-file: '**/CMakeLists.txt'
- any-glob-to-any-file: '**/CMakeLists.txt'

lib:
- changed-files:
- any-glob-to-any-file:
- 'include/**'
- 'src/lib/**'
- any-glob-to-any-file:
- 'include/**'
- 'src/lib/**'

tests:
- changed-files:
- any-glob-to-any-file: 'test/**'
- any-glob-to-any-file: 'test/**'
965 changes: 495 additions & 470 deletions .github/workflows/build.yaml

Large diffs are not rendered by default.

121 changes: 62 additions & 59 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Documentation

on: [push, pull_request]
on: [ push, pull_request ]

permissions:
contents: read
Expand All @@ -12,34 +12,37 @@ jobs:
generate:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Doxygen
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install graphviz qtbase5-dev qtbase5-doc-dev qtconnectivity5-dev qtconnectivity5-doc-html qttools5-dev qttools5-dev-tools
curl --location --silent "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" |
tar --extract --gzip --directory "$RUNNER_TEMP"
"$RUNNER_TEMP/doxygen-${DOXYGEN_VERSION}/bin/doxygen" --version
- name: Build docs
run: |
cmake -D "DOXYGEN_EXECUTABLE=$RUNNER_TEMP/doxygen-${DOXYGEN_VERSION}/bin/doxygen" -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
cmake --build "$RUNNER_TEMP" --target doc doc-internal
- name: Upload public docs
uses: actions/upload-artifact@v4
with:
name: public-docs
path: "${{ runner.temp }}/doc/public"
if-no-files-found: error
- name: Upload internal docs
uses: actions/upload-artifact@v4
with:
name: internal-docs
path: "${{ runner.temp }}/doc/internal"
if-no-files-found: error
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Doxygen
env:
BASE_URL: https://github.com/doxygen/doxygen/releases/download/Release_
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install graphviz qtbase5{,-doc}-dev qtconnectivity5-{dev,doc-html} qttools5-dev{,-tools}
curl --location --silent "${BASE_URL}${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" |
tar --extract --gzip --directory "$RUNNER_TEMP"
"$RUNNER_TEMP/doxygen-${DOXYGEN_VERSION}/bin/doxygen" --version
- name: Build docs
run: |
cmake -D "DOXYGEN_EXECUTABLE=$RUNNER_TEMP/doxygen-${DOXYGEN_VERSION}/bin/doxygen" \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
cmake --build "$RUNNER_TEMP" --target doc doc-internal
- name: Upload public docs
uses: actions/upload-artifact@v4
with:
name: public-docs
path: "${{ runner.temp }}/doc/public"
if-no-files-found: error
- name: Upload internal docs
uses: actions/upload-artifact@v4
with:
name: internal-docs
path: "${{ runner.temp }}/doc/internal"
if-no-files-found: error

publish:
permissions:
Expand All @@ -48,33 +51,33 @@ jobs:
if: success() && (github.ref == 'refs/heads/main')
needs: generate
steps:
- uses: actions/checkout@v4
with: { ref: doc }
- name: Clear previous docs
run: rm -rf main/{doc,int}
- name: Download public docs
uses: actions/download-artifact@v4
with:
name: public-docs
path: main/doc
- name: Download internal docs
uses: actions/download-artifact@v4
with:
name: internal-docs
path: main/int
- name: Inject version selectors
run: ./.selector.sh
- name: Inspect changes # for diagnostics only.
run: |
git status
git diff
- name: Push updates
run: |
[[ -z $(git status --porcelain) ]] || {
git config user.name github-actions
git config user.email [email protected]
git pull
git add .
git commit -m "Update generated docs for ${GITHUB_SHA}"
git push
}
- uses: actions/checkout@v4
with: { ref: doc }
- name: Clear previous docs
run: rm -rf main/{doc,int}
- name: Download public docs
uses: actions/download-artifact@v4
with:
name: public-docs
path: main/doc
- name: Download internal docs
uses: actions/download-artifact@v4
with:
name: internal-docs
path: main/int
- name: Inject version selectors
run: ./.selector.sh
- name: Inspect changes # for diagnostics only.
run: |
git status
git diff
- name: Push updates
run: |
[[ -z $(git status --porcelain) ]] || {
git config user.name github-actions
git config user.email [email protected]
git pull
git add .
git commit -m "Update generated docs for ${GITHUB_SHA}"
git push
}
26 changes: 13 additions & 13 deletions .github/workflows/lupdate.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Translations

on: [push, pull_request]
on: [ push, pull_request ]

permissions:
contents: read
Expand All @@ -9,15 +9,15 @@ jobs:
lupdate:
runs-on: ubuntu-24.04
steps:
- name: Install Qt
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install qt6-{base-{dev{,-tools},doc-dev},connectivity-{dev,doc-html},l10n-tools,tools-dev{,-tools}}
- uses: actions/checkout@v4
- name: Check translation files
run: |
cmake -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
cmake --build "$RUNNER_TEMP" --target {cli,QtPokit}_lupdate # \todo Include gui too, when relevant.
[[ -z $(git status --porcelain | tee /dev/stderr) ]]
- name: Install Qt
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install qt6-{base-{dev{,-tools},doc-dev},connectivity-{dev,doc-html},l10n-tools,tools-dev{,-tools}}
- uses: actions/checkout@v4
- name: Check translation files
run: |
cmake -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
cmake --build "$RUNNER_TEMP" --target {cli,QtPokit}_lupdate # \todo Include gui too, when relevant.
[[ -z $(git status --porcelain | tee /dev/stderr) ]]
63 changes: 32 additions & 31 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
- sonar
pull_request:
types: [opened, synchronize, reopened]
types: [ opened, synchronize, reopened ]

permissions:
contents: read
Expand All @@ -18,34 +18,35 @@ jobs:
fail-fast: false
matrix:
env:
- { cc: clang, cxx: clang++ }
- { cc: gcc, cxx: g++ }
- { cc: clang, cxx: clang++ }
- { cc: gcc, cxx: g++ }
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Qt
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install lcov qtbase5-dev qtbase5-doc-dev qtconnectivity5-dev qtconnectivity5-doc-html qttools5-dev qttools5-dev-tools
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v3
- name: Run build-wrapper
env:
CC: ${{ matrix.env.cc }}
CXX: ${{ matrix.env.cxx }}
PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.env.cc }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_COVERAGE=${{ startsWith(matrix.env.cc, 'gcc') && 'ON' || 'OFF'}} -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
build-wrapper-linux-x86-64 --out-dir "$RUNNER_TEMP/sonar" cmake --build "$RUNNER_TEMP" --config Release
- name: Run sonar-scanner
# Generate only one report for now, since Sonar can only deal with one (could just as easily be clang).
if: matrix.env.cxx == 'g++' && github.actor != 'dependabot[bot]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define project.settings=.sonar.properties \
--define sonar.cfamily.build-wrapper-output="$RUNNER_TEMP/sonar"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Qt
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install lcov qtbase5{,-doc}-dev qtconnectivity5-{dev,doc-html} qttools5-dev{,-tools}
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v3
- name: Run build-wrapper
env:
CC: ${{ matrix.env.cc }}
CXX: ${{ matrix.env.cxx }}
PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.env.cc }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_COVERAGE=${{ startsWith(matrix.env.cc, 'gcc') && 'ON' || 'OFF'}} \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
build-wrapper-linux-x86-64 --out-dir "$RUNNER_TEMP/sonar" cmake --build "$RUNNER_TEMP" --config Release
- name: Run sonar-scanner
# Generate only one report for now, since Sonar can only deal with one (could just as easily be clang).
if: matrix.env.cxx == 'g++' && github.actor != 'dependabot[bot]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define project.settings=.sonar.properties \
--define sonar.cfamily.build-wrapper-output="$RUNNER_TEMP/sonar"
82 changes: 44 additions & 38 deletions .github/workflows/static.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Static Analysis

on: [push, pull_request]
on: [ push, pull_request ]

permissions:
contents: read
Expand All @@ -13,44 +13,50 @@ jobs:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Qt
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install qtbase5-dev qtbase5-doc-dev qtconnectivity5-dev qtconnectivity5-doc-html qttools5-dev qttools5-dev-tools
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
- name: Build
run: |
cmake -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
cmake --build "$RUNNER_TEMP"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
- uses: actions/checkout@v4
- name: Install Qt
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install qtbase5{,-doc}-dev qtconnectivity5-{dev,doc-html} qttools5-dev{,-tools}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
- name: Build
run: |
cmake -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
cmake --build "$RUNNER_TEMP"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

Cppcheck:
runs-on: ubuntu-24.04
steps:
- name: Install Cppcheck
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install cppcheck
- uses: actions/checkout@v4
- name: Perform Cppcheck Analysis
run: ./.cppcheck.sh --xml --xml-version=2 2> "$RUNNER_TEMP/cppcheck.xml"
- name: Generate Report
if: ${{ failure() }}
run: |
cppcheck-htmlreport --title=Dokit --file="$RUNNER_TEMP/cppcheck.xml" \
--report-dir="$RUNNER_TEMP/report" --source-dir="$GITHUB_WORKSPACE"
- name: Upload Report
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: Cppcheck HTML Report
path: "${{ runner.temp }}/report"
- name: Install Cppcheck
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install cppcheck
- uses: actions/checkout@v4
- name: Perform Cppcheck Analysis
run: ./.cppcheck.sh --xml --xml-version=2 2> "$RUNNER_TEMP/cppcheck.xml"
- name: Generate Report
if: ${{ failure() }}
run: |
cppcheck-htmlreport --title=Dokit --file="$RUNNER_TEMP/cppcheck.xml" \
--report-dir="$RUNNER_TEMP/report" --source-dir="$GITHUB_WORKSPACE"
- name: Upload Report
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: Cppcheck HTML Report
path: "${{ runner.temp }}/report"

yamllint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: yamllint .
24 changes: 24 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
extends: default

ignore: /doc/doxygen-awesome-css

rules:
braces:
max-spaces-inside: 1
min-spaces-inside: 1
brackets:
max-spaces-inside: 1
min-spaces-inside: 1
commas:
max-spaces-after: -1
comments:
min-spaces-from-content: 1
document-start: disable
indentation:
check-multi-line-strings: false
indent-sequences: true
spaces: 2
line-length:
max: 120
truthy:
check-keys: false

0 comments on commit b53ecff

Please sign in to comment.