From 4189061302e7055fd83b2265be914490ca82fc93 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Mon, 23 Feb 2026 16:21:57 -0500 Subject: [PATCH 1/2] chore: add basic ci tests, publish scaffolding Signed-off-by: Todd Baert --- ...t-and-lint.yml => ci-format-test-lint.yml} | 40 ++++++++++--------- .github/workflows/lint-pr.yml | 23 +++++++++++ .github/workflows/release-please.yml | 31 ++++++++++++++ CONTRIBUTING.md | 2 +- WORKSPACE | 2 + 5 files changed, 78 insertions(+), 20 deletions(-) rename .github/workflows/{clang-format-and-lint.yml => ci-format-test-lint.yml} (63%) create mode 100644 .github/workflows/lint-pr.yml create mode 100644 .github/workflows/release-please.yml create mode 100644 WORKSPACE diff --git a/.github/workflows/clang-format-and-lint.yml b/.github/workflows/ci-format-test-lint.yml similarity index 63% rename from .github/workflows/clang-format-and-lint.yml rename to .github/workflows/ci-format-test-lint.yml index bb372fc..bc3a59e 100644 --- a/.github/workflows/clang-format-and-lint.yml +++ b/.github/workflows/ci-format-test-lint.yml @@ -1,36 +1,38 @@ -name: clang-format-and-lint +name: CI on: + push: + branches: ["main"] pull_request: branches: ["main"] - paths: - [ - "**.c", - "**.cpp", - "**.h", - "**.hpp", - "**.cxx", - "**.hxx", - "**.cc", - "**.hh", - "**CMakeLists.txt", - "meson.build", - "**.cmake", - ] jobs: - clang-format-and-lint: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: bazel-contrib/setup-bazel@0.18.0 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + + - name: Build + run: bazel build //... + + - name: Test + run: bazel test //test/... + + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: bazel-contrib/setup-bazel@0.18.0 with: - # Avoid downloading Bazel every time. bazelisk-cache: true - # Store build cache per workflow. disk-cache: ${{ github.workflow }} - # Share repository cache between workflows. repository-cache: true - name: Build compilation database diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 0000000..6b3bf48 --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,23 @@ +name: 'Lint PR Title' + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + main: + permissions: + pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs + statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@ac7e3fc035c47465748bbcb1a822c1583cf79bbc + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..2f13496 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,31 @@ +name: Release + +on: + push: + branches: ["main"] + +permissions: + contents: read + +jobs: + release-please: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + issues: write + + # Release-please creates a PR that tracks all changes + steps: + - uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.RELEASE_PLEASE_ACTION_TOKEN }} + + # TODO: publishing goes here + # publish: + # environment: publish + # runs-on: ubuntu-latest + # permissions: + # contents: read + # needs: release-please + # if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 642afc0..9c84e38 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ git submodule update --init --recursive and run tests with, ``` - +bazel test //test/... ``` ### Opening a Pull Request diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000..aa526f6 --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,2 @@ +# This file intentionally left empty. +# This project uses Bzlmod (MODULE.bazel) for dependency management. From 55b135f046b60db02d3c1007468904f865937324 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Mon, 23 Feb 2026 20:22:43 -0500 Subject: [PATCH 2/2] Rename CI workflow to ci-format-test-lint Signed-off-by: Todd Baert --- .github/workflows/ci-format-test-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-format-test-lint.yml b/.github/workflows/ci-format-test-lint.yml index bc3a59e..68476c3 100644 --- a/.github/workflows/ci-format-test-lint.yml +++ b/.github/workflows/ci-format-test-lint.yml @@ -1,4 +1,4 @@ -name: CI +name: ci-format-test-lint on: push: