Skip to content

Commit 6c029af

Browse files
authored
Add GitHub Actions CI and Dependabot (#1)
## Summary - Add `.github/workflows/ci.yml` — CI workflow with JDK matrix [21, 25], `ktlintCheck` + `test`, test artifact upload, Dependabot auto-merge - Add `.github/dependabot.yml` — weekly dependency updates for Gradle (grouped: production vs testing) and GitHub Actions, with auto-merge via shared SML workflow Implements [KOJAK-34](https://softwaremill.atlassian.net/browse/KOJAK-34). ## Details **CI workflow:** - Triggers on push to `main` and PRs - Matrix: JDK 21 (minimum, `jvmToolchain(21)`) + JDK 25 (latest LTS) - `fail-fast: false` for full signal on both JDK versions - `permissions: contents: write` + `pull-requests: write` (required for auto-merge) - Third-party actions SHA-pinned (`gradle/actions`), GitHub-owned use version tags **Dependabot auto-merge:** - `auto-merge-dependabot` job calls shared `softwaremill/github-actions-workflows` auto-merge workflow - Uses `SOFTWAREMILL_CI_PR_TOKEN` PAT to trigger downstream CI on merge to main - Dependabot PRs labeled `automerge` via `dependabot.yml` config - Follows sttp-ai/tapir pattern **Dependabot:** - `gradle` ecosystem with two groups: `production` (exposed, spring, jackson, drivers) and `testing` (kotest, testcontainers, wiremock) — separate risk levels, auto-classified via `dependency-type` - `github-actions` ecosystem for keeping workflow actions current **Out of scope (deferred to KOJAK-35):** - Release-drafter, release notes, Maven Central publishing ## Test plan - [ ] CI workflow triggers on this PR with two matrix jobs (JDK 21, JDK 25) - [ ] `ktlintCheck` passes on both JDK versions - [ ] All tests pass on both JDK versions (including Testcontainers-based integration tests) - [ ] Create `automerge` label in GitHub repo settings (or verify Dependabot auto-creates it on first PR)
1 parent 4f104db commit 6c029af

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 2
2+
updates:
3+
# Keep Gradle dependencies up to date
4+
- package-ecosystem: "gradle"
5+
directory: "/"
6+
labels:
7+
- "automerge"
8+
schedule:
9+
interval: "weekly"
10+
open-pull-requests-limit: 10
11+
groups:
12+
production:
13+
dependency-type: "production"
14+
testing:
15+
dependency-type: "development"
16+
17+
# Keep GitHub Actions up to date
18+
- package-ecosystem: "github-actions"
19+
directory: "/"
20+
labels:
21+
- "automerge"
22+
schedule:
23+
interval: "weekly"
24+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches: [ main ]
5+
push:
6+
branches: [ main ]
7+
8+
permissions:
9+
contents: write # auto-merge requirement
10+
pull-requests: write # auto-merge requirement
11+
12+
jobs:
13+
ci:
14+
runs-on: ubuntu-24.04
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
java: [ "21", "25" ]
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up JDK ${{ matrix.java }}
24+
uses: actions/setup-java@v4
25+
with:
26+
distribution: 'temurin'
27+
java-version: ${{ matrix.java }}
28+
29+
- name: Setup Gradle
30+
uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4
31+
32+
- name: Check formatting
33+
run: ./gradlew ktlintCheck
34+
35+
- name: Test
36+
run: ./gradlew test
37+
38+
- name: Upload test results
39+
uses: actions/upload-artifact@v4
40+
if: success() || failure()
41+
with:
42+
name: test-results-java-${{ matrix.java }}
43+
path: '**/build/test-results/test/TEST-*.xml'
44+
45+
auto-merge-dependabot:
46+
# only for PRs by dependabot[bot]
47+
if: github.event.pull_request.user.login == 'dependabot[bot]'
48+
needs: [ ci ]
49+
uses: softwaremill/github-actions-workflows/.github/workflows/auto-merge.yml@main
50+
secrets:
51+
github-token: ${{ secrets.SOFTWAREMILL_CI_PR_TOKEN }}

0 commit comments

Comments
 (0)