|
20 | 20 | default: "21.0.6" |
21 | 21 |
|
22 | 22 | secrets: |
| 23 | + github-token: |
| 24 | + description: "GitHub Token with permissions to checkout the repository." |
| 25 | + required: true |
23 | 26 | gradle-cache-username: |
24 | 27 | description: "The username used to authenticate with the Gradle Build Cache Node." |
25 | 28 | required: true |
@@ -52,26 +55,18 @@ jobs: |
52 | 55 | file: ${{ steps.baseline.outputs.file }} |
53 | 56 | name: ${{ steps.baseline.outputs.name }} |
54 | 57 | steps: |
55 | | - - name: Harden Runner |
56 | | - uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 |
57 | | - with: |
58 | | - egress-policy: audit |
59 | | - |
60 | | - - name: Checkout Code |
61 | | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
62 | | - with: |
63 | | - ref: ${{ inputs.ref }} |
64 | | - |
65 | | - - name: Setup Java |
66 | | - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 |
67 | | - with: |
68 | | - distribution: ${{ inputs.java-distribution }} |
69 | | - java-version: ${{ inputs.java-version }} |
70 | | - |
71 | | - - name: Setup Gradle |
72 | | - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 |
| 58 | + - name: Prepare Job |
| 59 | + uses: pandaswhocode/initialize-github-job@a57cd6d8d768b2f3c95334bdd4fa8c21609fc651 # v1.0.5 |
73 | 60 | with: |
74 | | - cache-disabled: true |
| 61 | + checkout: "true" |
| 62 | + checkout-ref: "${{ inputs.ref }}" |
| 63 | + checkout-token: "${{ secrets.github-token }}" |
| 64 | + checkout-fetch-depth: "1" |
| 65 | + setup-java: "true" |
| 66 | + java-distribution: "${{ inputs.java-distribution }}" |
| 67 | + java-version: "${{ inputs.java-version }}" |
| 68 | + setup-gradle: "true" |
| 69 | + gradle-cache-read-only: "false" |
75 | 70 |
|
76 | 71 | - name: Authenticate to Google Cloud |
77 | 72 | id: google-auth |
@@ -121,7 +116,7 @@ jobs: |
121 | 116 | run: gsutil cp "${{ steps.manifest.outputs.file }}" "${{ steps.baseline.outputs.file }}" |
122 | 117 |
|
123 | 118 | generate-matrix: |
124 | | - name: "Generate OS Matrix for Determinism Verification" |
| 119 | + name: "Gradle: Generate OS Matrix" |
125 | 120 | runs-on: hl-cn-gradle-determinism-lin-ss |
126 | 121 | outputs: |
127 | 122 | os-matrix: ${{ steps.set-matrix.outputs.os-matrix }} |
@@ -182,36 +177,35 @@ jobs: |
182 | 177 | fail-fast: false |
183 | 178 | matrix: ${{ fromJSON(needs.generate-matrix.outputs.os-matrix) }} |
184 | 179 | steps: |
185 | | - - name: Harden Runner |
186 | | - uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 |
187 | | - with: |
188 | | - egress-policy: audit |
189 | | - |
190 | 180 | - name: Standardize Git Line Endings |
191 | 181 | run: | |
192 | 182 | git config --global core.autocrlf false |
193 | 183 | git config --global core.eol lf |
194 | 184 |
|
195 | | - - name: Checkout Code |
196 | | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 185 | + - name: Prepare Job |
| 186 | + uses: pandaswhocode/initialize-github-job@a57cd6d8d768b2f3c95334bdd4fa8c21609fc651 # v1.0.5 |
197 | 187 | with: |
198 | | - ref: ${{ inputs.ref }} |
199 | | - |
200 | | - - name: Setup Python |
201 | | - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
202 | | - with: |
203 | | - python-version: 3.9 |
204 | | - |
205 | | - - name: Setup Java |
206 | | - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 |
207 | | - with: |
208 | | - distribution: ${{ inputs.java-distribution }} |
209 | | - java-version: ${{ inputs.java-version }} |
| 188 | + checkout: "true" |
| 189 | + checkout-ref: "${{ inputs.ref }}" |
| 190 | + checkout-token: "${{ secrets.github-token }}" |
| 191 | + checkout-fetch-depth: "1" |
| 192 | + setup-java: "true" |
| 193 | + java-distribution: "${{ inputs.java-distribution }}" |
| 194 | + java-version: "${{ inputs.java-version }}" |
| 195 | + setup-gradle: "true" |
| 196 | + gradle-cache-read-only: "false" |
| 197 | + |
| 198 | + - name: Install Python (Linux) |
| 199 | + if: ${{ runner.os == 'Linux' }} |
| 200 | + run: | |
| 201 | + sudo apt-get update |
| 202 | + sudo apt-get install --yes --no-install-recommends python3 python3-venv python3-pip |
210 | 203 |
|
211 | | - - name: Setup Gradle |
212 | | - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 |
| 204 | + - name: Install Python |
| 205 | + if: ${{ runner.os != 'Linux' }} |
| 206 | + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
213 | 207 | with: |
214 | | - cache-disabled: true |
| 208 | + python-version: "3.12" |
215 | 209 |
|
216 | 210 | - name: Setup CoreUtils (macOS) |
217 | 211 | if: ${{ runner.os == 'macOS' }} |
|
0 commit comments