Skip to content

Commit 1e219ed

Browse files
ci: Add GH workflows to validate PR titles to follow Conventional Commits and run tests. (#54)
1 parent 4f809d6 commit 1e219ed

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "pr-title-checks"
2+
3+
on:
4+
pull_request_target:
5+
# NOTE: Workflows triggered by this event give the workflow access to secrets and grant the
6+
# `GITHUB_TOKEN` read/write repository access by default. So we need to ensure:
7+
# - This workflow doesn't inadvertently check out, build, or execute untrusted code from the
8+
# pull request triggered by this event.
9+
# - Each job has `permissions` set to only those necessary.
10+
types: ["edited", "opened", "reopened"]
11+
branches: ["main"]
12+
13+
permissions: {}
14+
15+
concurrency:
16+
group: "${{github.workflow}}-${{github.ref}}"
17+
18+
# Cancel in-progress jobs for efficiency
19+
cancel-in-progress: true
20+
21+
jobs:
22+
conventional-commits:
23+
permissions:
24+
# For amannn/action-semantic-pull-request
25+
pull-requests: "read"
26+
runs-on: "ubuntu-latest"
27+
steps:
28+
- uses: "amannn/action-semantic-pull-request@v5"
29+
env:
30+
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"

.github/workflows/unit-tests.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "unit-tests"
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
# Run daily at 00:20 UTC
8+
- cron: "20 0 * * *"
9+
workflow_dispatch:
10+
11+
permissions: {}
12+
13+
concurrency:
14+
group: "${{github.workflow}}-${{github.ref}}"
15+
16+
# Cancel in-progress jobs for efficiency
17+
cancel-in-progress: true
18+
19+
jobs:
20+
unit-tests:
21+
strategy:
22+
matrix:
23+
os:
24+
- "ubuntu-22.04"
25+
- "ubuntu-24.04"
26+
runs-on: "${{matrix.os}}"
27+
steps:
28+
- uses: "actions/checkout@v4"
29+
with:
30+
submodules: "recursive"
31+
32+
- name: "Install task"
33+
shell: "bash"
34+
run: "npm install -g @go-task/cli"
35+
36+
- name: "Run unit tests"
37+
run: "task test"

0 commit comments

Comments
 (0)