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..68476c3 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-format-test-lint 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.