Skip to content

Commit f48d57f

Browse files
Switch CI to hardened runners with JFrog OIDC authentication
Route Maven dependency resolution through JFrog Artifactory on hardened runners that block direct access to Maven Central. Authenticate via GitHub Actions OIDC (zero stored secrets). - Add composite action for JFrog OIDC + Java setup - Switch fmt, unit-tests (Linux), and check-lock to databricks-protected-runner-group - Add workflow-level id-token: write permission for OIDC - Keep macOS unit-tests on public runners (not hardened) NO_CHANGELOG=true
1 parent 4d195ac commit f48d57f

2 files changed

Lines changed: 59 additions & 19 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Setup build environment
2+
description: Set up JDK with JFrog OIDC authentication for hardened runners
3+
4+
inputs:
5+
java-version:
6+
description: "Java version to install"
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Setup JFrog CLI with OIDC
13+
if: runner.os != 'macOS'
14+
uses: jfrog/setup-jfrog-cli@279b1f629f43dd5bc658d8361ac4802a7ef8d2d5 # v4.9.1
15+
env:
16+
JF_URL: https://databricks.jfrog.io
17+
with:
18+
oidc-provider-name: github-actions
19+
20+
- name: Set up JDK
21+
uses: actions/setup-java@b6e674f4b717d7b0ae3baee0fbe79f498905dfde # v1.4.4
22+
with:
23+
java-version: ${{ inputs.java-version }}

.github/workflows/push.yml

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,25 @@ on:
66
merge_group:
77
types: [checks_requested]
88

9+
permissions:
10+
id-token: write
11+
contents: read
12+
913
jobs:
1014
fmt:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Set up JDK 11
14-
uses: actions/setup-java@b6e674f4b717d7b0ae3baee0fbe79f498905dfde # v1.4.4
15-
with:
16-
java-version: 11
15+
runs-on:
16+
group: databricks-protected-runner-group
17+
labels: linux-ubuntu-latest
1718

19+
steps:
1820
- name: Checkout
1921
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
2022

23+
- name: Setup build environment
24+
uses: ./.github/actions/setup-build-environment
25+
with:
26+
java-version: 11
27+
2128
- name: Cache Maven packages
2229
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
2330
with:
@@ -32,20 +39,27 @@ jobs:
3239
strategy:
3340
fail-fast: false
3441
matrix:
35-
os: [macos-latest, ubuntu-latest]
42+
os:
43+
- name: linux
44+
runner:
45+
group: databricks-protected-runner-group
46+
labels: linux-ubuntu-latest
47+
- name: macos
48+
runner: macos-latest
3649
java-version: [8, 11, 17, 20] # 20 is the latest version as of 2023 and 17 is the latest LTS
3750

38-
runs-on: ${{ matrix.os }}
51+
name: "unit-tests (${{ matrix.os.name }}, java ${{ matrix.java-version }})"
52+
runs-on: ${{ matrix.os.runner }}
3953

4054
steps:
41-
- name: Set up JDK
42-
uses: actions/setup-java@b6e674f4b717d7b0ae3baee0fbe79f498905dfde # v1.4.4
43-
with:
44-
java-version: ${{ matrix.java-version }}
45-
4655
- name: Checkout
4756
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
4857

58+
- name: Setup build environment
59+
uses: ./.github/actions/setup-build-environment
60+
with:
61+
java-version: ${{ matrix.java-version }}
62+
4963
- name: Cache Maven packages
5064
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
5165
with:
@@ -57,15 +71,18 @@ jobs:
5771
run: mvn --errors test
5872

5973
check-lock:
60-
runs-on: ubuntu-latest
61-
steps:
62-
- name: Set up JDK 11
63-
uses: actions/setup-java@b6e674f4b717d7b0ae3baee0fbe79f498905dfde # v1.4.4
64-
with:
65-
java-version: 11
74+
runs-on:
75+
group: databricks-protected-runner-group
76+
labels: linux-ubuntu-latest
6677

78+
steps:
6779
- name: Checkout
6880
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
6981

82+
- name: Setup build environment
83+
uses: ./.github/actions/setup-build-environment
84+
with:
85+
java-version: 11
86+
7087
- name: Validate lockfile
7188
run: make check-lock

0 commit comments

Comments
 (0)