Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name-template: "MQSS Client $RESOLVED_VERSION Release"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "🚀 Features and Enhancements"
labels:
- "enhancement"
- "feature"
- "refactor"
- "usability"
- title: "🐛 Bug Fixes"
labels:
- "bug"
- "fix"
- title: "📄 Documentation"
labels:
- "documentation"
- title: "🤖 CI"
labels:
- "continuous integration"
- title: "📦 Packaging"
labels:
- "packaging"
- title: "🧹 Code Quality"
labels:
- "code quality"
- title: "⬆️ Dependencies"
collapse-after: 5
labels:
- "dependencies"
- "github-actions"
- "pre-commit"
- "submodules"
change-template: "- $TITLE ([#$NUMBER]($URL)) (**@$AUTHOR**)"
change-title-escapes: '\<*_&'
version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
patch:
labels:
- "patch"
default: patch

template: |
## 👀 What Changed

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
51 changes: 51 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"config:recommended",
":gitSignOff",
"helpers:pinGitHubActionDigestsToSemver",
":automergeDigest",
":automergeStableNonMajor",
":combinePatchMinorReleases",
":configMigration",
":enablePreCommit",
":prConcurrentLimitNone",
":prHourlyLimitNone",
],
enabledManagers: ["github-actions", "pep621", "pre-commit"],
lockFileMaintenance: {
enabled: true,
automerge: true,
},
labels: ["dependencies"],
schedule: ["every weekend"],
packageRules: [
{
matchManagers: ["github-actions"],
addLabels: ["github-actions"],
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC68\u200D\uD83D\uDCBB",
},
{
matchManagers: ["pep621"],
addLabels: ["python"],
commitMessagePrefix: "⬆\uFE0F\uD83D\uDC0D",
},
{
matchManagers: ["pre-commit"],
addLabels: ["pre-commit"],
commitMessagePrefix: "⬆\uFE0F\uD83E\uDE9D",
versioning: "pep440",
},
{
matchUpdateTypes: ["lockFileMaintenance"],
commitMessagePrefix: "⬆\uFE0F\uD83D\uDD12\uFE0F",
},
{
description: "Group and automerge all patch updates",
groupName: "patch updates",
groupSlug: "all-patch",
matchUpdateTypes: ["patch"],
automerge: true,
},
],
}
72 changes: 71 additions & 1 deletion .github/workflows/mqss_client-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@ on:
branches: ["develop"]
pull_request:
branches: ["develop"]
merge_group:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Install dependencies
run: |
Expand Down Expand Up @@ -48,3 +56,65 @@ jobs:
- name: Run tests
run: |
ctest --test-dir build --output-on-failure --no-tests=error

coverage:
name: Coverage
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Codecov upload via OIDC
steps:
- name: Checkout repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false

- name: Install dependencies
run: |
sudo apt update -y
sudo apt-get install -y \
cmake \
librabbitmq-dev \
libboost-dev \
libgtest-dev \
libgmock-dev \
libcurl4-openssl-dev \
gcovr

# Instrument the whole build (library and tests); MQSSCLIENT_ENABLE_COVERAGE
# only instruments the test executables.
- name: Configure with coverage instrumentation
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DMQSSCLIENT_BUILD_UNIT_TESTS=ON \
-DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage \
-DCMAKE_EXE_LINKER_FLAGS=--coverage -DCMAKE_SHARED_LINKER_FLAGS=--coverage

- name: Build
run: cmake --build build --parallel

- name: Run tests
run: ctest --test-dir build --output-on-failure --no-tests=error

- name: Collect coverage
run: gcovr --root . --filter src/ --filter include/ --xml coverage.xml --print-summary build

- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
# Switch to true (as in QDMI) once the repository is registered with Codecov.
fail_ci_if_error: false
files: coverage.xml
flags: cpp

required-checks-pass: # This job does nothing and is only used for branch protection
name: 🚦 Check
if: always()
needs:
- build
- coverage
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
with:
jobs: ${{ toJSON(needs) }}
11 changes: 8 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ on:
tags:
- "v*.*.*" # Trigger on version tags

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2.8.0
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # v2.3.4
with:
python-version: "3.x"

Expand All @@ -31,6 +36,6 @@ jobs:
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.MQSS_PYPI_API_TOKEN }}
run: uv publish -v -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD}
run: uv publish -v -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} # zizmor: ignore[use-trusted-publishing] TODO: switch to PyPI trusted publishing
- name: Test package installation
run: uv run --with mqss-client --no-project -- python -c "import mqss_client"
17 changes: 17 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release Drafter

on:
push:
branches:
- develop

permissions: {}

jobs:
update_release_draft:
name: Run
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@d1a19e60e81a7e650d00a7de9277f87e439117ea # v7.11.0
9 changes: 8 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,12 @@ repos:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.2
hooks:
- id: check-dependabot
- id: check-renovate
additional_dependencies: [json5]
- id: check-github-workflows

## Check for security issues in GitHub Actions workflows
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.33.0
hooks:
- id: zizmor
Loading