Skip to content

Commit 4189061

Browse files
committed
chore: add basic ci tests, publish scaffolding
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
1 parent 3b805aa commit 4189061

5 files changed

Lines changed: 78 additions & 20 deletions

File tree

.github/workflows/clang-format-and-lint.yml renamed to .github/workflows/ci-format-test-lint.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1-
name: clang-format-and-lint
1+
name: CI
22

33
on:
4+
push:
5+
branches: ["main"]
46
pull_request:
57
branches: ["main"]
6-
paths:
7-
[
8-
"**.c",
9-
"**.cpp",
10-
"**.h",
11-
"**.hpp",
12-
"**.cxx",
13-
"**.hxx",
14-
"**.cc",
15-
"**.hh",
16-
"**CMakeLists.txt",
17-
"meson.build",
18-
"**.cmake",
19-
]
208

219
jobs:
22-
clang-format-and-lint:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
15+
- uses: bazel-contrib/setup-bazel@0.18.0
16+
with:
17+
bazelisk-cache: true
18+
disk-cache: ${{ github.workflow }}
19+
repository-cache: true
20+
21+
- name: Build
22+
run: bazel build //...
23+
24+
- name: Test
25+
run: bazel test //test/...
26+
27+
lint:
2328
runs-on: ubuntu-latest
2429
steps:
2530
- uses: actions/checkout@v6
2631

2732
- uses: bazel-contrib/setup-bazel@0.18.0
2833
with:
29-
# Avoid downloading Bazel every time.
3034
bazelisk-cache: true
31-
# Store build cache per workflow.
3235
disk-cache: ${{ github.workflow }}
33-
# Share repository cache between workflows.
3436
repository-cache: true
3537

3638
- name: Build compilation database

.github/workflows/lint-pr.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Lint PR Title'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions: # added using https://github.com/step-security/secure-workflows
11+
contents: read
12+
13+
jobs:
14+
main:
15+
permissions:
16+
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
17+
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
18+
name: Validate PR title
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: amannn/action-semantic-pull-request@ac7e3fc035c47465748bbcb1a822c1583cf79bbc
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
release-please:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
issues: write
17+
18+
# Release-please creates a PR that tracks all changes
19+
steps:
20+
- uses: googleapis/release-please-action@v4
21+
with:
22+
token: ${{ secrets.RELEASE_PLEASE_ACTION_TOKEN }}
23+
24+
# TODO: publishing goes here
25+
# publish:
26+
# environment: publish
27+
# runs-on: ubuntu-latest
28+
# permissions:
29+
# contents: read
30+
# needs: release-please
31+
# if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ git submodule update --init --recursive
3131

3232
and run tests with,
3333
```
34-
34+
bazel test //test/...
3535
```
3636

3737
### Opening a Pull Request

WORKSPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file intentionally left empty.
2+
# This project uses Bzlmod (MODULE.bazel) for dependency management.

0 commit comments

Comments
 (0)